Giter Club home page Giter Club logo

pykep's Introduction

pykep

Join the chat at https://gitter.im/esa/pykep

Build Status Code Health

pykep is a scientific library providing basic tools for astrodynamics research. Algorithmic efficiency is a main focus of the library, which is written in C++ and exposed to Python using the boost::python library. At the library core is the implementation of an efficient solver for the multiple revolutions Lambert's problem, objects representing direct (Sims-Flanagan), indirect (Pontryagin) and hybrid methods to represent low-thrust optimization problems, efficient keplerian propagators, Taylor-integrators, a SGP4 propagator, TLE and SATCAT support and more.

Check the official documentation at https://esa.github.io/pykep/

pykep's People

Contributors

abitrolly avatar albertoibm avatar badidzetai avatar chrisandre avatar cisprague avatar darioizzo avatar dariomm098 avatar dhennes avatar dietmarwo avatar fchapoton avatar gitter-badger avatar gomezzz avatar jackyarndley avatar johannessimon81 avatar jonathanwillitts avatar mikeheddes avatar mlooz avatar mrtreasurer avatar nattybumppo avatar pabloem avatar pmateusz avatar sanjeev-narayanaswamy avatar sceki avatar tniessen avatar wbnns avatar yawgmoth90 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pykep's Issues

Can't import pykep on mac osx

I followed all installation instructions and successfully built pykep with the native python 2.7 on my machine, which runs MacOs Mojave.

image

When I try to import the pykep module I get the following error regarding the core module. Am I trying to import from the correct directory?

image

I downloaded boost with brew, and I've tried with brew python3 using the

cmake ../ -DBUILD_PYKEP="ON" -DPYTHON_EXECUTABLE="/usr/bin/python3.7m"

command, but cmake throws an error saying it can't find the python include directory.

image

I'm very new to using python/building with cmake, so any feedback you can give is much appreciated.

Thanks,

Jackson

install problem under linux

Hallo,

(sorry if my question sounds unprofessional or the is trivial to you - I have never ever before compiled anything myself - till pyKep everything I needed came via packetmanager)

I tried to follow the install instructions under https://esa.github.io/pykep/installation.html.

My system: (L)Ubuntu 14.04, Python installed: 2.7(default) and 3.4

(Before doing anything fancy like installing it for both versions, I decided to first try it on the default python, which links to 2.7)

Having the prerequisites installed, I created a directory and did the git pull

git clone https://github.com/esa/pykep.git

, which created a dir with the pykep files in it. So far, so good.

In the downloaded dir there was said to be a directory "keptoolbox", which nowhere was to be found. so I decided to take the "pykep"-dir instead and created the suggested "build"-dir there.

in build/ I called

ccmake ../

populated the fields with "c" and switched BUILD_PYKEP to ON. then pressed "g" (nothing happened) and then "q" to exit ccmake.

then typed

make
and all I got was a "no targets"-error

2nd try: I changed to the pykep dir directly and did

ccmake .

again "g" and then "q" and then "make ". Same result as before: "no targets"-error

when I start ccmake and populate the fields it looks like this:

BUILD_MAIN ON
BUILD_PYKEP ON
BUILD_SPICE OFF
BUILD_TESTS ON
CMAKE_BUILD_TYPE Release
CMAKE_INSTALL_PREFIX /usr/local
INSTALL_HEADERS OFF
PYTHON_EXECUTABLE /usr/bin/python
PYTHON_INCLUDE_DIR /usr/include/python2.7
PYTHON_LIBRARIES
PYTHON_MODULES_DIR /usr/lib/python2.7/dist-packages
PYTHON_VERSION 2.7

Can anyone please help me? Is the install instruction outdated?

*Update: *
I switched my default python to 3.4 (wanted to change anyway) but still got the problems from above.

*Update #2: *
I tried the suggested specifying of the python version now:

ccmake ../ -DBUILD_PYKEP="ON" -DPYTHON_EXECUTABLE="/usr/bin/python3.3m"

and while populating with "c" got the error "boost_python3 missing some libraries". checked the packetmanager and there was no packet boost_python3. only libboost mpi python.

so I thought switching to 3.4 after installing boost was a bad idea. deinstalled boost, reinstalled boost.
same error from ccmake about the missing boost python3 libs

Cannot run PyKep on MacOS High Sierra

Computer Info: Macbook Pro
OS: MacOS High Sierra (10.13.5)

I am using a miniconda3 environment with pygmo2 and Python 3.7.1, installed directly through conda, following the installation instructions.

When I try to install pykep for Unix based systems, I had a lot of trouble building it as there seemed to be linking issues with boost. I changed some things in the make file options, which can be seen in the below images, to try to link to the right python environment as well the boost python library included in miniconda3.
screen shot 2019-02-13 at 2 23 36 pm
screen shot 2019-02-13 at 2 23 58 pm

This configuration allowed me to build and install everything without errors (which was a miracle for me as it took me a couple days to not get a "Boost::python37-NOTFOUND" error.

When I import pykep into a python session, I don't get any errors. However, if I run the example script:
import pykep as kp
pk.examples.run_example1(impulses = 3)
I get this error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'pykep' has no attribute 'examples'

My friends, who also all have similar builds with MacOS are experiencing the same issue. Any advice for getting everything up and running smoothly?

Problem getting the example to work

Hi,

To test my installation of PyKEP I made a script lam.py with the following code:
from PyKEP import *
examples.run_example2()

(source: http://esa.github.io/pykep/examples/ex2.html)

When I run this code I get the following error message.

_Traceback (most recent call last):
File "lam.py", line 1, in
from PyKEP import *
File "/usr/lib/python2.7/dist-packages/PyKEP/init.py", line 45, in
from PyKEP import core, sims_flanagan, orbit_plots, examples, trajopt, phasing, util, planet
File "/usr/lib/python2.7/dist-packages/PyKEP/core/init.py", line 3, in
from PyKEP.core._core import _get_AU, _get_JR, _get_DAY2SEC, _get_DAY2YEAR, _get_DEG2RAD, _get_EARTH_VELOCITY, _get_G0, _get_MU_SUN, _get_RAD2DEG, _get_SEC2DAY
ImportError: /usr/lib/python2.7/dist-packages/PyKEP/core/_core.so: undefined symbol: ZTIN5boost6python15instance_holderE

I don't know what to do anymore. I tried running it with both python 2.7 and 3.4 and tried to relink the boost libraries with different versions of python.
Many thanks in advance,
Enne

planet.keplerian.ref_mjd2000 should be float not epoch

pl = planet.keplerian(epoch(0), (1., 0., 0), (0., 1., 0.), 1., 0., 0., 0.)
type(pl.ref_mjd2000)
>>> PyKEP.core._core.epoch

The instance object ref_mjd2000 of PyKEP.planet.keplerian should be a float and not epoch. Alternatively, one could rename the it to ref_epoch.

make test in PyKEP under Anaconda fail

I'm attempting to install PyKEP on a MacBook Pro under Mac OS X ver. 10.10.2 under the Anaconda python environment.

I've rebuilt Boost ver. 1.57.0 under the Anaconda Python environment per the directions on http://www.boost.org/doc/libs/1_57_0/more/getting_started/unix-variants.html#easy-build-and-install (section 5.1 on that page). I have not yet installed PyGMO. The following shows the commands and results in building PyKEP:

users-MacBook-Pro:build user$ cmake -DBUILD_PYKEP="ON" \

  -DPYTHON_EXECUTABLE=/Users/user/anaconda/bin/python2.7  \
  -DPYTHON_INCLUDE_DIR=/Users/user/anaconda/include/python2.7  \
  -DPYTHON_LIBRARY=/Users/user/anaconda/lib/python2.7/config/libpython2.7.a   \
  -DBOOST_ROOT=/Users/user/boost_1_57_0_anaconda  ..

-- The C compiler identification is Clang 6.0.0
-- The CXX compiler identification is Clang 6.0.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- OS detected: Darwin
-- CXX Compiler detected: Clang
-- CMake additional search path for libraries: /usr/local/lib
-- Performing Test CLANG_TEMPLATE_DEPTH
-- Performing Test CLANG_TEMPLATE_DEPTH - Success
-- Enabling '-ftemplate-depth=256' compiler flag required since boost 1.54.
-- Performing Test ALL_C11
-- Performing Test ALL_C11 - Success
-- Enabling '-std=c++11' compiler flag
-- CXX compilation flags: -ftemplate-depth=256 -std=c++11
-- Found PythonInterp: /Users/user/anaconda/bin/python2.7 (found version "2.7.9")
-- Python interpreter: /Users/user/anaconda/bin/python2.7
-- Python interpreter verison: 2.7
-- Python includes path: /Users/user/anaconda/include/python2.7
-- Python modules install path: /Users/user/anaconda/lib/python2.7/site-packages
-- Python library name: /Users/user/anaconda/lib/libpython2.7.dylib
-- Required Boost libraries: serialization;date_time;python
-- Boost version: 1.57.0
-- Found the following Boost libraries:
-- serialization
-- date_time
-- python
-- Detected Boost version: 105700
-- Boost include dirs: /Users/user/boost_1_57_0_anaconda/include
-- Boost libraries: /Users/user/boost_1_57_0_anaconda/lib/libboost_serialization.dylib;/Users/user/boost_1_57_0_anaconda/lib/libboost_date_time.dylib;/Users/user/boost_1_57_0_anaconda/lib/libboost_python.dylib
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:

PYTHON_LIBRARY

-- Build files have been written to: /Users/user/pykep/build
users-MacBook-Pro:build user$ make
Scanning dependencies of target keplerian_toolbox_static
[ 1%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/epoch.cpp.o
[ 3%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/lambert_problem.cpp.o
[ 5%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/sims_flanagan/leg.cpp.o
[ 7%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/sims_flanagan/spacecraft.cpp.o
[ 9%] Building C object src/CMakeFiles/keplerian_toolbox_static.dir/core_functions/jorba.c.o
[ 11%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/planets/planet.cpp.o
[ 13%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/planets/asteroid_gtoc2.cpp.o
[ 15%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/planets/asteroid_gtoc5.cpp.o
[ 17%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/planets/asteroid_gtoc7.cpp.o
[ 19%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/planets/planet_mpcorb.cpp.o
[ 21%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/planets/planet_ss.cpp.o
[ 23%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/planets/planet_js.cpp.o
[ 25%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/planets/planet_tle.cpp.o
[ 27%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/third_party/libsgp4/Util.cpp.o
[ 29%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/third_party/libsgp4/Tle.cpp.o
[ 31%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/third_party/libsgp4/SolarPosition.cpp.o
[ 33%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/third_party/libsgp4/SGP4.cpp.o
[ 35%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/third_party/libsgp4/OrbitalElements.cpp.o
[ 37%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/third_party/libsgp4/Observer.cpp.o
[ 39%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/third_party/libsgp4/Eci.cpp.o
Linking CXX static library libkeplerian_toolbox_static.a
[ 39%] Built target keplerian_toolbox_static
Scanning dependencies of target main
[ 41%] Building CXX object CMakeFiles/main.dir/main.cpp.o
Linking CXX executable main
[ 41%] Built target main
Scanning dependencies of target keplerian_toolbox
[ 43%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/epoch.cpp.o
[ 45%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/lambert_problem.cpp.o
[ 47%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/sims_flanagan/leg.cpp.o
[ 49%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/sims_flanagan/spacecraft.cpp.o
[ 50%] Building C object src/CMakeFiles/keplerian_toolbox.dir/core_functions/jorba.c.o
[ 52%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/planets/planet.cpp.o
[ 54%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/planets/asteroid_gtoc2.cpp.o
[ 56%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/planets/asteroid_gtoc5.cpp.o
[ 58%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/planets/asteroid_gtoc7.cpp.o
[ 60%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/planets/planet_mpcorb.cpp.o
[ 62%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/planets/planet_ss.cpp.o
[ 64%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/planets/planet_js.cpp.o
[ 66%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/planets/planet_tle.cpp.o
[ 68%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/third_party/libsgp4/Util.cpp.o
[ 70%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/third_party/libsgp4/Tle.cpp.o
[ 72%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/third_party/libsgp4/SolarPosition.cpp.o
[ 74%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/third_party/libsgp4/SGP4.cpp.o
[ 76%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/third_party/libsgp4/OrbitalElements.cpp.o
[ 78%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/third_party/libsgp4/Observer.cpp.o
[ 80%] Building CXX object src/CMakeFiles/keplerian_toolbox.dir/third_party/libsgp4/Eci.cpp.o
Linking CXX shared library libkeplerian_toolbox.dylib
[ 80%] Built target keplerian_toolbox
Scanning dependencies of target _core
[ 82%] Building CXX object PyKEP/core/CMakeFiles/_core.dir/core.cpp.o
Linking CXX shared library _core.so
[ 82%] Built target _core
Scanning dependencies of target _sims_flanagan
[ 84%] Building CXX object PyKEP/sims_flanagan/CMakeFiles/_sims_flanagan.dir/sims_flanagan.cpp.o
Linking CXX shared library _sims_flanagan.so
[ 84%] Built target _sims_flanagan
Scanning dependencies of target lambert_test
[ 86%] Building CXX object tests/CMakeFiles/lambert_test.dir/lambert_test.cpp.o
Linking CXX executable lambert_test
[ 86%] Built target lambert_test
Scanning dependencies of target leg_s_test
[ 88%] Building CXX object tests/CMakeFiles/leg_s_test.dir/leg_s_test.cpp.o
Linking CXX executable leg_s_test
[ 88%] Built target leg_s_test
Scanning dependencies of target propagate_lagrangian_test
[ 90%] Building CXX object tests/CMakeFiles/propagate_lagrangian_test.dir/propagate_lagrangian_test.cpp.o
Linking CXX executable propagate_lagrangian_test
[ 90%] Built target propagate_lagrangian_test
Scanning dependencies of target propagate_lagrangian_u_test
[ 92%] Building CXX object tests/CMakeFiles/propagate_lagrangian_u_test.dir/propagate_lagrangian_u_test.cpp.o
Linking CXX executable propagate_lagrangian_u_test
[ 92%] Built target propagate_lagrangian_u_test
Scanning dependencies of target propagate_taylor_jorba_test
[ 94%] Building CXX object tests/CMakeFiles/propagate_taylor_jorba_test.dir/propagate_taylor_jorba_test.cpp.o
Linking CXX executable propagate_taylor_jorba_test
[ 94%] Built target propagate_taylor_jorba_test
Scanning dependencies of target propagate_taylor_s_test
[ 96%] Building CXX object tests/CMakeFiles/propagate_taylor_s_test.dir/propagate_taylor_s_test.cpp.o
Linking CXX executable propagate_taylor_s_test
[ 96%] Built target propagate_taylor_s_test
Scanning dependencies of target propagate_taylor_test
[ 98%] Building CXX object tests/CMakeFiles/propagate_taylor_test.dir/propagate_taylor_test.cpp.o
Linking CXX executable propagate_taylor_test
[ 98%] Built target propagate_taylor_test
Scanning dependencies of target sgp4_test
[100%] Building CXX object tests/CMakeFiles/sgp4_test.dir/sgp4_test.cpp.o
Linking CXX executable sgp4_test
[100%] Built target sgp4_test

Lastly, I did a make test to test the above build as a check prior to doing the install and got the following results:

users-MacBook-Pro:build user$ make test
Running tests...
Test project /Users/user/pykep/build
Start 1: Testing_Multiple_Revolution_Lambert's_Solver
1/8 Test #1: Testing_Multiple_Revolution_Lambert's_Solver ........................................_Exception: Other 0.10 sec
Start 2: Testing_Keplerian_propagation_via_Lagrange_Coefficients_and_osculating_elements
2/8 Test #2: Testing_Keplerian_propagation_via_Lagrange_Coefficients_and_osculating_elements .....
_Exception: Other 0.08 sec
Start 3: Testing_Keplerian_propagation_via_Lagrange_Coefficients_and_universal_variables
3/8 Test #3: Testing_Keplerian_propagation_via_Lagrange_Coefficients_and_universal_variables ....._Exception: Other 0.07 sec
Start 4: Testing_Taylor_propagation_of_an_inertially_fixed_thrust_PyKEP_implementation
4/8 Test #4: Testing_Taylor_propagation_of_an_inertially_fixed_thrust_PyKEP_implementation .......
_Exception: Other 0.07 sec
Start 5: Testing_Taylor_propagation_of_an_inertially_fixed_thrust_Jorba_implementation
5/8 Test #5: Testing_Taylor_propagation_of_an_inertially_fixed_thrust_Jorba_implementation ......._Exception: Other 0.07 sec
Start 6: Testing_Taylor_propagation_of_an_inertially_fixed_thrust_in_the_Sundmann_Variable
6/8 Test #6: Testing_Taylor_propagation_of_an_inertially_fixed_thrust_in_the_Sundmann_Variable ...
_Exception: Other 0.07 sec
Start 7: Testing_Leg_in_The_Sundmann_Variable
7/8 Test #7: Testing_Leg_in_The_Sundmann_Variable ................................................_Exception: Other 0.07 sec
Start 8: Testing_SGP4_propagation
8/8 Test #8: Testing_SGP4_propagation ............................................................
_Exception: Other 0.07 sec

0% tests passed, 8 tests failed out of 8

Total Test time (real) = 0.65 sec

The following tests FAILED:
1 - Testing_Multiple_Revolution_Lambert's_Solver (OTHER_FAULT)
2 - Testing_Keplerian_propagation_via_Lagrange_Coefficients_and_osculating_elements (OTHER_FAULT)
3 - Testing_Keplerian_propagation_via_Lagrange_Coefficients_and_universal_variables (OTHER_FAULT)
4 - Testing_Taylor_propagation_of_an_inertially_fixed_thrust_PyKEP_implementation (OTHER_FAULT)
5 - Testing_Taylor_propagation_of_an_inertially_fixed_thrust_Jorba_implementation (OTHER_FAULT)
6 - Testing_Taylor_propagation_of_an_inertially_fixed_thrust_in_the_Sundmann_Variable (OTHER_FAULT)
7 - Testing_Leg_in_The_Sundmann_Variable (OTHER_FAULT)
8 - Testing_SGP4_propagation (OTHER_FAULT)
Errors while running CTest
make: *** [test] Error 8
users-MacBook-Pro:build user$

Let me say from the beginning I'm not a C++ expert, yet having said that what do I need to do to fix this problem and proceed?

Please advise.

No feasible solution

Good evening,

I am a student from Instituto Superior Técnico, Lisbon. I am using pykep and pygmo, namely the module lt_margo, in order to optimise a continuous-thrust trajectory (in the context of a project from a Masters course). However, when I run the example 11 with the algorithm compass search (for max_fevals=100), I cannot find any feasible solution. I would be grateful if someone could provide insight into this issue.

Kind regards,

Vasco Grilo

Load the SPICE Kernel files to compute the ephemerides

Hi,

So I am new to PYKEP, and I have been trying to compute some high precision ephemerides, from SPICE Kernels.
My code is really simple, as I just want to get the ephemerides, before anything else. This is what I have so far:

from PyKEP import *

planet = planet.spice('EARTH', 'SUN', 'ECLIPJ2000', 'NONE', MU_SUN, MU_EARTH, EARTH_RADIUS, EARTH_RADIUS * 1.05)

r,v=planet.eph(epoch(5700,"mjd2000"))

And this is what I get:

Toolkit version: N0065

SPICE(NOLOADEDFILES) --

At least one SPK file needs to be loaded by SPKLEF before beginning a search.

A traceback follows. The name of the highest level module is first.
spkezr_c --> SPKEZR --> SPKEZ --> SPKGEO --> SPKSFS

============================================================================
Traceback (most recent call last):
File "/Users/eduardopires/PycharmProjects/01Pykep/test.py", line 7, in
r,v=planet.eph(epoch(5700,"mjd2000"))
RuntimeError: SPICE cannot compute the ephemerides, have you loaded all needed Kernel files?

Now I know I have to load the Kernels, but which Kernel should I load?
And how do I actually load it?

Thanks in advance,
EPiress

Study the precision of a Lambert linear acceleration model for low-thrust arcs approximations

  1. Take two asteroids from the asteroid main belt (e.g. gtoc7 planets) and compute a Lambert arc joining them.
  2. Find such an arc so that its cumulative DV is small.
  3. Develop and compute a linear acceleration model to connect the two asteroids in the required time and compute from it the mass ratio (i.e. final mass of the spacecraft over initial mass of the spacecraft). Use the Lambert boundary velocities to help the model.
  4. Compare the results to a full low-thrust optimization (sims-flanagan)
  5. repeat for several asteroids pairs and Lambert times.

Lambert's problem returning Nan for solutions

Sorry if this is a stupid question but I am having issues obtaining solutions to pykep.lambert_problem. When I run the following code:

def solve(start, duration):
    end = epoch(start.mjd2000 + duration)
    
    rE, vE = earth.eph(start)
    rM, vR = mars.eph(end)
    
    solutions = lambert_problem(rE, rM, duration * DAY2SEC, 1, False, 10)
    return solutions 

print(solve(epoch(0), 100))
print(solve(epoch(0), 250))

The following output is produced:

Lambert's problem:
mu = 1
r1 = [-25216645728.283768, 144924279081.32498, -38276.915766745136]
r2 = [23677305175.045235, 231466356243.12106, 4266858429.7063341]
Time of flight: 12960000

chord = 99490481765.445
semiperimeter = 239652783689.69
lambda = -0.7647586039895
non dimensional time of flight = 1.5622347089048e-010

Maximum number of revolutions: 0
Solutions: 
0 revs, Iters: 2, x: 10144799071.114, a: -1.1643018370483e-009
	v1= [5023.8501386881999, -28872.906706436665, 0.007625815528971497] v2= [2981.7979772545937, 29149.681847056359, 537.34619463111062]

Lambert's problem:
mu = 1
r1 = [-25216645728.283768, 144924279081.32498, -38276.915766745136]
r2 = [-75608690053.379578, 228832446904.45093, 6651899885.3798294]
Time of flight: 17280000

chord = 98102941036.502
semiperimeter = 243148200110.85
lambda = 0.77235371442086
non dimensional time of flight = 2.0382251088785e-010

Maximum number of revolutions: 0
Solutions: 
0 revs, Iters: 1, x: nan, a: nan
	v1= [-nan, -nan, -nan] v2= [-nan, -nan, -nan]

There is always a solution to Lambert's problem so I am confused as to why the function is returning -nan for the second solution. Any guidance on why this may be would be much appreciated.

Installing PyKEP under Windows 64bit, Python 3

Hi, PyKEP Team.

I have a Windows 10 64bit system with 64bit Anaconda (Python 3.5) installed. I successfully installed PyKEP using the v1.2.2 64bit Python 3 (PyKEP.1.2.2.64-bit.py3.msi) pre-compiled Windows binaries in my Anaconda environment's site-packages directory. The thing is, when I try to import it from Python, I get the following traceback error:

>>> import PyKEP
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Anaconda3\envs\test\lib\site-packages\PyKEP\__init__.py", line 45, in <module>
    from PyKEP import core, sims_flanagan, orbit_plots, examples, trajopt, phasing, util, planet
  File "C:\Anaconda3\envs\test\lib\site-packages\PyKEP\core\__init__.py", line 3, in <module>
    from PyKEP.core._core import _get_AU, _get_JR, _get_DAY2SEC, _get_DAY2YEAR, _get_DEG2RAD, _get_EARTH_VELOCITY, _get_G0, _get_MU_SUN, _get_RAD2DEG, _get_SEC2DAY
ImportError: DLL load failed: The specified module could not be found.

I also tried this on a Windows 7 64bit computer and had identical results.

I Googled around and found that some users were experiencing "DLL load failed" errors (not related to PyKEP, just this error in general) that were due to missing MS Visual C DLLs, and they had luck installing the msvcp71.dll and msvcr71.dll, but that didn't help -- I still get the same traceback on both the Win7 and Win10 systems.

Any guidance on what the issue might be?

(No issues building PyKEP from source on several Linux machines, however!)

PyKEP syntax error after PaGMO installation

We installed on our CentOS 7 Machine PyKEP (clone from github, installation was followed from https://esa.github.io/pykep/installation.html). PyKEP alone worked fine.
After that, we installed PyGMO (clone from gitgub, installation was followed from http://esa.github.io/pygmo/install.html). Now we can use PyGMO, but as soon as we want to use PyKEP, we get an syntax error.

>>> from PyKEP import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/PyKEP/__init__.py", line 48, in <module>
    from PyKEP import core, sims_flanagan, pontryagin, orbit_plots, examples, phasing, util, planet, trajopt
  File "/usr/lib/python2.7/site-packages/PyKEP/trajopt/__init__.py", line 17, in <module>
    from PyKEP.trajopt._indirect import _indirect_base, indirect_pt2pt, indirect_pl2pl, indirect_or2or, indirect_pt2or
  File "/usr/lib/python2.7/site-packages/PyKEP/trajopt/_indirect.py", line 195
    lb = [self.t0lb, self.Tlb, *[-1e2] * 7]
                               ^
SyntaxError: invalid syntax

Any ideas?

Please advise.
Thanks alot.

Crash when importing pykep on Mac OS

After installing pykep using conda for Python 3.7 on MacOS, running import pykep as pk gives the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/matthew/anaconda3/lib/python3.7/site-packages/pykep/__init__.py", line 48, in <module>
    from pykep import core, sims_flanagan, pontryagin, orbit_plots, examples, phasing, util, planet, trajopt
  File "/Users/matthew/anaconda3/lib/python3.7/site-packages/pykep/pontryagin/__init__.py", line 4, in <module>
    from ._leg import leg
  File "/Users/matthew/anaconda3/lib/python3.7/site-packages/pykep/pontryagin/_leg.py", line 1, in <module>
    from pykep.pontryagin._dynamics import _dynamics
  File "/Users/matthew/anaconda3/lib/python3.7/site-packages/pykep/pontryagin/_dynamics.py", line 6, in <module>
    class _dynamics(object):
  File "/Users/matthew/anaconda3/lib/python3.7/site-packages/pykep/pontryagin/_dynamics.py", line 8, in _dynamics
    def __init__(self, sc=spacecraft(1000, 0.3, 2500), mu=MU_SUN, alpha=1, bound=True):
TypeError: __init__() should return None, not 'NoneType'

Make test fails on Ubuntu with Anaconda 32-bit Python 2.7

I completed all the necessary preparation steps (including installation of cmake, boost, etc.), and when I run the make command everything builds properly until this point:

[ 98%] Building CXX object PyKEP/core/CMakeFiles/_core.dir/core.cpp.o
/home/mp/pykep/PyKEP/core/core.cpp:1893039:287: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-4.6/README.Bugs for instructions.
Preprocessed source stored into /tmp/cceGTORs.out file, please attach this to your bugreport.
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/_usr_lib_gcc_i686-linux-gnu_4.6_cc1plus.0.crash'
make[2]: *** [PyKEP/core/CMakeFiles/_core.dir/core.cpp.o] Error 1
make[1]: *** [PyKEP/core/CMakeFiles/_core.dir/all] Error 2
make: *** [all] Error 2

Any idea how I can resolve this issue?

Error installing Pykep on MacOSX

I followed all the instructions from here

cd pykep
mkdir build
cd build
cmake ../ -DBUILD_PYKEP="ON"  -DPYTHON_EXECUTABLE="/usr/local/bin/python3.7m"

But when I run

sudo make install

I get the following error

[ 82%] Built target lambert_test
[ 84%] Built target propagate_lagrangian_test
[ 87%] Built target propagate_lagrangian_u_test
[ 89%] Built target propagate_taylor_s_test
pykep/core/CMakeFiles/_core.dir/build.make:82: *** target pattern contains no `%'.  Stop.
make[1]: *** [pykep/core/CMakeFiles/_core.dir/all] Error 2
make: *** [all] Error 2

Cannot import TLE files using Python 3

When trying to import TLE files using the pykep.util.read_tle() function in Python 3, the following error occurs:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-12-6ec78f5cd0e5> in <module>
----> 1 iridiumDebris = pykep.util.read_tle("iridium-33-debris.txt")

~/anaconda3/envs/pykepTest3/lib/python3.6/site-packages/pykep/util/__init__.py in read_tle(tle_file, verbose, with_name)
     70         for line in f:
     71             if with_name:
---> 72                 line1 = f.next()[:69]
     73             else:
     74                 line1 = line[:69]

AttributeError: '_io.TextIOWrapper' object has no attribute 'next'

example 1 fails with "ValueError: math domain error"

$ python3 /local/scratch/bgodard/sw/anaconda3/lib/python3.6/site-packages/pykep/examples/_ex1.py
CMAES 4 PaGMO: 
mu: 10 - lambda: 20 - mueff: 5.9388 - N: 11
cc: 0.282335 - cs: 0.361861 - c1: 0.0127203 - cmu: 0.0469557 - sigma: 0.5 - damps: 1.36186 - chiN: 3.24255

   Gen:        Fevals:          Best:            dx:            df:         sigma:
      1              0        15468.6        2625.02    1.68662e+06            0.5
Traceback (most recent call last):
  File "/local/scratch/bgodard/sw/anaconda3/lib/python3.6/site-packages/pykep/examples/_ex1.py", line 39, in <module>
    run_example1()
  File "/local/scratch/bgodard/sw/anaconda3/lib/python3.6/site-packages/pykep/examples/_ex1.py", line 29, in run_example1
    pop = algo.evolve(pop)
  File "/local/scratch/bgodard/sw/anaconda3/lib/python3.6/site-packages/pykep/examples/_ex_utilities.py", line 17, in fitness
    return self.prob.fitness(x)
  File "/local/scratch/bgodard/sw/anaconda3/lib/python3.6/site-packages/pykep/trajopt/_pl2pl_N_impulses.py", line 98, in fitness
    T[i] = log(x[2 + 4 * i])
ValueError: math domain error

This is with anaconda packages:

pykep                     2.1                      py36_1    conda-forge
pagmo                     2.7                           0    conda-forge
pygmo                     2.7                      py36_0    conda-forge

on Redhat Linux 7.5.

Same problem on Ubuntu 18.04 freshly installed and up to date anaconda.

Equality comparator for a third party dependency always returns false

Issue

Trivial error in equality comparator of CoordGeodetic from libsgp4. See that the equal variable is always false.

bool IsEqual(const CoordGeodetic &geo) const
{
        bool equal = false;
        if (latitude == geo.latitude && longitude == geo.longitude && altitude == geo.altitude) {
            equal = false;
        }
        return equal;
}

Fixed in #79

Code a fixed point in space as a planet object

A simple planet object that returns always the same three coordinates as ephemerides. This simple planet (a fixed star) would derive from kep_toolbox::planets::base and reimplement the eph.

Python exposition would also need to be provided.

pip install pykep is not working on macOS

We are using pykep for one of our projects, but users on macOS are experiencing a problem with the installation of pykep using pip. Below are the screenshots of the errors
Screenshot 2019-05-31 at 4 24 00 AM
This is causing build failure on sphinx docs build of our project as shown below
Screenshot 2019-05-28 at 8 55 38 AM

macOS version: 10.14.5

Outdated examples in orbit_plot module documentation

What's wrong

Sphinx autogen documentation of the esa.github.io web interface uses the docstrings of python functions to write the doc page. Examples in several docstring of the module orbit_plotting are outdated or straight buggy. Git blame shows they were written in 2015, they just need a bit of refreshment.

env and version : conda binaries for windows, pykep ver 2.3

Resolution

I forked, will write working examples and do a PR in the next days

Segmentation fault while running example 11

Platform information :

  • macOS Mojave, 10.14.4

Got libsnopt7.dylib from https://ccom.ucsd.edu/~optimizers/downloads/

Example 11

Python 2.7.15 | packaged by conda-forge | (default, Feb 27 2019, 20:44:16) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pykep as pk
>>> pk.examples.run_example11()

Output :

 ==============================
    SNOPT  C interface  2.2.0   
 ==============================
 S N O P T  7.7.1    (Nov 2018)
 ==============================
 
 SNMEMA EXIT 100 -- finished successfully
 SNMEMA INFO 104 -- memory requirements estimated

 Trial version of SNOPT -- for evaluation or academic purposes only
 

 Nonlinear constraints      37     Linear constraints       1
 Nonlinear variables        93     Linear variables         0
 Jacobian  variables        93     Objective variables     93
 Total constraints          38     Total variables         93
 

 
Segmentation fault: 11

I also tried running following example :

from pygmo import *
from pygmo_plugins_nonfree import snopt7
from pykep.examples import add_gradient, algo_factory

algo = algorithm(snopt7(screen_output = False, library = "libsnopt7.dylib"))

algo.set_verbosity(1)
prob = problem(cec2006(prob_id = 1))
prob.c_tol = [1e-6]*9
pop = population(prob, 1)
pop = algo.evolve(pop)
print pop

Output :

SNOPT7 plugin for pagmo/pygmo: 
The gradient sparsity is assumed dense: 130 components detected.
The gradient is computed numerically by SNOPT7.

Insufficient storage allocated - not enough integer storage
Problem name: CEC2006 - g1
	Global dimension:			13
	Integer dimension:			0
	Fitness dimension:			10
	Number of objectives:			1
	Equality constraints dimension:		0
	Inequality constraints dimension:	9
	Tolerances on constraints: [1e-06, 1e-06, 1e-06, 1e-06, 1e-06, ... ]
	Lower bounds: [0, 0, 0, 0, 0, ... ]
	Upper bounds: [1, 1, 1, 1, 1, ... ]

	Has gradient: false
	User implemented gradient sparsity: false
	Has hessians: false
	User implemented hessians sparsity: false

	Fitness evaluations: 1

	Thread safety: basic

Population size: 1

List of individuals: 
#0:
	ID:			5957976106111536803
	Decision vector:	[0.983528, 0.646107, 0.307131, 0.622509, 0.663707, ... ]
	Fitness vector:		[-214.431, -214.431, -214.431, -214.431, -214.431, ... ]

Champion decision vector: [0.983528, 0.646107, 0.307131, 0.622509, 0.663707, ... ]
Champion fitness: [-214.431, -214.431, -214.431, -214.431, -214.431, ... ]

I am not sure why i am facing this problem.

Thanks,
Aniket

Github.io documentation detail wrong for sims_flanagan leg

Hello everyone,

The pykep documentation for sims_flanagan leg mentions the high_fidelity as a method, but try to use the example

l.high_fidelity(True)

results in error "Boolean is not callable", while using

l.high_fidelity = True

works. This suggests from the Python point of view, it is indeed an attribute and is to be manipulated like one.

Is there a misunderstanding on my side, or is it a mistake in the documentation ? I'll do the PR to correct the docs, if so.

Best,
B.

Reference epochs for planet types

Reproduce issue:
python -c "from PyKEP.trajopt import * ; pl2pl_N_impulses()"

Result:
File "/usr/lib/python2.7/dist-packages/PyKEP/trajopt/_pl2pl_N_impulses.py", line 81, in init
lb = [start.ref_epoch.mjd2000, tof[0]] ...
AttributeError: 'jpl_lp' object has no attribute 'ref_epoch'

Cause:
The jpl_lp planet object no longer has a reference epoch member (from what I can tell in the boost python exports)

Should the jpl_lp or even the base planet implement a reference epoch? The keplerian planet does (maybe the planet refactor skipped this?).

Conceptually, is the reference epoch the epoch associated with the current planet state (position, velocity)?

Issue at "make -j2 install" (MacOS)

I have been trying to install Pykep for the last two days now without success. Hopefully, someone can help me out.
I began my latest attempt by using brew to install: python, cmake, boost, and boost-python. I then cloned the git directory, and began compiling the keplarian library using cmake. This ran fine, I was able to install using sudo make install, and all the test cases passed. I then created the "build_pykep" directory in the /pykep folder, cd'd into this dir., and ran a modified version of the command listed in the install guide for cmake:

cmake -DBoost_NO_BOOST_CMAKE=ON \
      -DPYKEP_BUILD_KEP_TOOLBOX=no \
      -DPYKEP_BUILD_PYKEP=yes \
      -DPYKEP_BUILD_TESTS=no \
      -DCMAKE_BUILD_TYPE=Release \
      -DBoost_PYTHON${PYTHON_VERSION}_LIBRARY_RELEASE=/usr/local/lib/${BOOST_PYTHON_LIBRARY_NAME} \
      -DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 ../;

The last line was modified to point cmake to the correct path where python is located. Otherwise I believe it was picking up the python 2.7 default install on macOS. This ran successfully, and I get the final terminal output:

Build files have been written to: /Users/rohanpatel/dev/dev_py/pykep/build_pykep

When I go to run sudo make -j2 install I get the following terminal out:

pykep/core/CMakeFiles/core.dir/build.make:97: *** target pattern contains no `%'.  Stop.
make[1]: *** [pykep/core/CMakeFiles/core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
pykep/planet/CMakeFiles/planet.dir/build.make:82: *** target pattern contains no `%'.  Stop.
make[1]: *** [pykep/planet/CMakeFiles/planet.dir/all] Error 2
make: *** [all] Error 2

I am not sure how to proceed from here. Any ideas? I am new to cmake and boost. This is my first time compiling a library as well.
I do not have an installation of Anaconda on my machine. I do have homebrew and have installed everything through it.

Thank you for the help, I appreciate it.

error when running examples with pygmo and SNOPT7

when I use snopt7 by running pygmo examples or pykep examples, I got ValueError: in code "pop = algo.evolve(pop)", but there is no problem when I run examples 1 and 2 in pykep.
My Computer : Widows10 64bit Python3.6 64bit, with these libs intalled :

matplotlib 3.0.0
numpy 1.15.2
pygmo 2.4
pygmo-plugins-nonfree 0.4
pykep 2.2
pyopt 0.84
scipy 1.1.0

I got a snopt libs and license from Standford's website, also the FORTAN and SNOPT_C interface libraries ,and copy them to "C:\Python\SnoptLib". They are "snopt7.dll, snopt7.lib, snopt7.lic, snopt7_c.dll, snopt7_c.lib".

The Test code is from pygmo examples or pykep, such as:
from pygmo import *
from pygmo_plugins_nonfree import snopt7
algo = algorithm(snopt7(screen_output = False, library = r"C:\Python\SnoptLib\snopt7_c.dll"))
algo.set_verbosity(1)
prob = problem(cec2006(prob_id = 1))
prob.c_tol = [1e-6]*9
pop = population(prob, 1)
pop = algo.evolve(pop)


ValueError Traceback (most recent call last)
in
6 prob.c_tol = [1e-6]*9
7 pop = population(prob, 1)
----> 8 pop = algo.evolve(pop)
ValueError:

when the SQP method is modified to NLOPT, there is no problem. So where is the trouble? Thank you for your answer.

Port to python 3

Modify the build system as to add the possibility of selecting and detecting python versions. Final aim is to help compilation in system with both python installed.

Build stops after barabasi-albert.cpp.o on Ubuntu 12.04

I have had numerous unsuccessful attempts over the past 2 years at building pagmo on Mac OS, Debian 7, Windows and recently Ubuntu 12.04.

The highest boost version officially available for Ubuntu 12.04 seems to be 1.48. Using libboost1.55 causes a segmentation error in the gcc compiler. Compilation is being done on a Parallels virtual server with 2gb ram and 14 processors. PyKEP isalready running fine on the Ubuntu 12.04 although this has also been made to work on all previous attempts on Mac OS, Debian and Windows.

With main selected in Cmake, the build process progresses without error as far as 77% but stops at barabasi-albert.cpp with a reference to adj_list_serialize_bug_fix.hpp:15:0 and thereafter about 200 further lines of other error messages mostly referencing serialization errors.

The CMakeList.txt has been edited to swap the $MANDATORY_LIBRARIES directive after pagmo_static as given in point 5 of the compilation guide.

Can anyone help me with this issue?

pip install pykep on Windows 10 64bit

Hello, I am trying to install pykep using pip in Anaconda Prompt but it seems there is an issue because I have the following error:

Collecting pykep
ERROR: Could not find a version that satisfies the requirement pykep (from versions: none)
ERROR: No matching distribution found for pykep

Best regards,

Edgar

Examples using PYGMO fail with Boost 1.57

When trying to run examples 1, 3, 4 and 5 with latest PyKEP and PyGMO the "Monotonic Basin Hopping" process takes place but in the end all die with the same message:

Traceback (most recent call last):
  File "/home/juanlu/.miniconda3/envs/pykep27/lib/python2.7/multiprocessing/queues.py", line 266, in _feed
    send(obj)
RuntimeError: unregistered class - derived class not registered or exported
  File "_ex5.py", line 22, in run_example5
    archi = archipelago(algo,prob,8,20, topology=topo)
  File "/home/juanlu/.miniconda3/envs/pykep27/lib/python2.7/site-packages/PyGMO/core/__init__.py", line 342, in _generic_archi_ctor
    self.push_back(island(args[0], args[1], args[3]))
  File "/home/juanlu/.miniconda3/envs/pykep27/lib/python2.7/site-packages/PyGMO/core/__init__.py", line 55, in __get_deepcopy__
    return deepcopy(self)
  File "/home/juanlu/.miniconda3/envs/pykep27/lib/python2.7/copy.py", line 182, in deepcopy
    rv = reductor(2)
RuntimeError: unregistered class - derived class not registered or exported

Google suggests that it is a Boost problem, but I run all PyKEP and PyGMO test and all pass (I have boost 1.57.0). I will try with earlier versions of PyGMO or Boost to see what happens.

Edit: 4 does not run because of #12.

Attempting to install PyKep under Python 3.6

I'm attempting to install PyKep on a Mac Pro (desktop) running Anaconda distribution for Python 3.6. The operating system is Mac OS X v. 10.12.6 (Sierra).

The problem I'm presently having is with specifying the directory containing the CMake configuration file for Boost. In looking through the Boost directory installed for the Anaconda Python 3, no CMake configuration file was found. I also have a version of Boost installed via Homebrew.

Beginning with my present problem, when Boost is installed for Anaconda, where does the CMake configuration reside? Now if I need to reinstall Boost, what is the procedure I need to follow?

Looking forward to hearing from you.

Sam Dupree.

Compilation error when I try to make

After doing ccmake .., I tried to run make, but I always get the following error:

[ 46%] Built target keplerian_toolbox
[ 92%] Built target keplerian_toolbox_static
[ 96%] Building CXX object PyKEP/core/CMakeFiles/_core.dir/core.o
In file included from /home/masasin/pykep/PyKEP/core/core.cpp:41:0:
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h: In static member function ‘static void* from_python_sequence<ContainerType, ConversionPolicy>::convertible(PyObject*)’:
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:225:43: error: there are no arguments to ‘PyString_Check’ that depend on a template parameter, so a declaration of ‘PyString_Check’ must be available [-fpermissive]
             || (   !PyString_Check(obj_ptr)
                                           ^
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:225:43: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:228:42: error: ‘struct _typeobject’ has no member named ‘ob_type’
                     || obj_ptr->ob_type->ob_type == 0
                                          ^
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:229:42: error: ‘struct _typeobject’ has no member named ‘ob_type’
                     || obj_ptr->ob_type->ob_type->tp_name == 0
                                          ^
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:231:44: error: ‘struct _typeobject’ has no member named ‘ob_type’
                          obj_ptr->ob_type->ob_type->tp_name,
                                            ^
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h: In instantiation of ‘static void* from_python_sequence<ContainerType, ConversionPolicy>::convertible(PyObject*) [with ContainerType = std::vector<double>; ConversionPolicy = variable_capacity_policy; PyObject = _object]’:
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:214:9:   required from ‘from_python_sequence<ContainerType, ConversionPolicy>::from_python_sequence() [with ContainerType = std::vector<double>; ConversionPolicy = variable_capacity_policy]’
/home/masasin/pykep/PyKEP/core/core.cpp:128:5:   required from here
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:225:43: error: ‘PyString_Check’ was not declared in this scope
             || (   !PyString_Check(obj_ptr)
                                           ^
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h: In instantiation of ‘static void* from_python_sequence<ContainerType, ConversionPolicy>::convertible(PyObject*) [with ContainerType = boost::array<double, 3ul>; ConversionPolicy = fixed_size_policy; PyObject = _object]’:
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:214:9:   required from ‘from_python_sequence<ContainerType, ConversionPolicy>::from_python_sequence() [with ContainerType = boost::array<double, 3ul>; ConversionPolicy = fixed_size_policy]’
/home/masasin/pykep/PyKEP/core/core.cpp:129:5:   required from here
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:225:43: error: ‘PyString_Check’ was not declared in this scope
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h: In instantiation of ‘static void* from_python_sequence<ContainerType, ConversionPolicy>::convertible(PyObject*) [with ContainerType = boost::array<double, 6ul>; ConversionPolicy = fixed_size_policy; PyObject = _object]’:
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:214:9:   required from ‘from_python_sequence<ContainerType, ConversionPolicy>::from_python_sequence() [with ContainerType = boost::array<double, 6ul>; ConversionPolicy = fixed_size_policy]’
/home/masasin/pykep/PyKEP/core/core.cpp:130:5:   required from here
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:225:43: error: ‘PyString_Check’ was not declared in this scope
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h: In instantiation of ‘static void* from_python_sequence<ContainerType, ConversionPolicy>::convertible(PyObject*) [with ContainerType = boost::array<double, 7ul>; ConversionPolicy = fixed_size_policy; PyObject = _object]’:
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:214:9:   required from ‘from_python_sequence<ContainerType, ConversionPolicy>::from_python_sequence() [with ContainerType = boost::array<double, 7ul>; ConversionPolicy = fixed_size_policy]’
/home/masasin/pykep/PyKEP/core/core.cpp:131:5:   required from here
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:225:43: error: ‘PyString_Check’ was not declared in this scope
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h: In instantiation of ‘static void* from_python_sequence<ContainerType, ConversionPolicy>::convertible(PyObject*) [with ContainerType = boost::array<double, 8ul>; ConversionPolicy = fixed_size_policy; PyObject = _object]’:
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:214:9:   required from ‘from_python_sequence<ContainerType, ConversionPolicy>::from_python_sequence() [with ContainerType = boost::array<double, 8ul>; ConversionPolicy = fixed_size_policy]’
/home/masasin/pykep/PyKEP/core/core.cpp:132:5:   required from here
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:225:43: error: ‘PyString_Check’ was not declared in this scope
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h: In instantiation of ‘static void* from_python_sequence<ContainerType, ConversionPolicy>::convertible(PyObject*) [with ContainerType = boost::array<double, 11ul>; ConversionPolicy = fixed_size_policy; PyObject = _object]’:
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:214:9:   required from ‘from_python_sequence<ContainerType, ConversionPolicy>::from_python_sequence() [with ContainerType = boost::array<double, 11ul>; ConversionPolicy = fixed_size_policy]’
/home/masasin/pykep/PyKEP/core/core.cpp:133:5:   required from here
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:225:43: error: ‘PyString_Check’ was not declared in this scope
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h: In instantiation of ‘static void* from_python_sequence<ContainerType, ConversionPolicy>::convertible(PyObject*) [with ContainerType = std::vector<boost::array<double, 3ul> >; ConversionPolicy = variable_capacity_policy; PyObject = _object]’:
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:214:9:   required from ‘from_python_sequence<ContainerType, ConversionPolicy>::from_python_sequence() [with ContainerType = std::vector<boost::array<double, 3ul> >; ConversionPolicy = variable_capacity_policy]’
/home/masasin/pykep/PyKEP/core/core.cpp:134:5:   required from here
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:225:43: error: ‘PyString_Check’ was not declared in this scope
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h: In instantiation of ‘static void* from_python_sequence<ContainerType, ConversionPolicy>::convertible(PyObject*) [with ContainerType = std::vector<boost::array<double, 8ul> >; ConversionPolicy = variable_capacity_policy; PyObject = _object]’:
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:214:9:   required from ‘from_python_sequence<ContainerType, ConversionPolicy>::from_python_sequence() [with ContainerType = std::vector<boost::array<double, 8ul> >; ConversionPolicy = variable_capacity_policy]’
/home/masasin/pykep/PyKEP/core/core.cpp:135:5:   required from here
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:225:43: error: ‘PyString_Check’ was not declared in this scope
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h: In instantiation of ‘static void* from_python_sequence<ContainerType, ConversionPolicy>::convertible(PyObject*) [with ContainerType = std::vector<boost::array<double, 11ul> >; ConversionPolicy = variable_capacity_policy; PyObject = _object]’:
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:214:9:   required from ‘from_python_sequence<ContainerType, ConversionPolicy>::from_python_sequence() [with ContainerType = std::vector<boost::array<double, 11ul> >; ConversionPolicy = variable_capacity_policy]’
/home/masasin/pykep/PyKEP/core/core.cpp:136:5:   required from here
/home/masasin/pykep/PyKEP/core/../boost_python_container_conversions.h:225:43: error: ‘PyString_Check’ was not declared in this scope
make[2]: *** [PyKEP/core/CMakeFiles/_core.dir/core.o] エラー 1
make[1]: *** [PyKEP/core/CMakeFiles/_core.dir/all] エラー 2
make: *** [all] エラー 2

It seems that there is a problem with the code itself?

I am running on Ubuntu 13.10.

JPL SPICE usage

I understand that JPL SPICE has been integrated into the latest version of PyKEP. How do I call SPICE functions. For example, say I want to load in a .bsp file using str2et. Is it possible to call this function using any tools from PyKEP?

Python modules have explicit framework links

Hi. I am one of the homebrew-science package managers. We distribute pykep through our package manager for OS X. Our CI is complaining about pykep being linked to a specific python:

  • python modules have explicit framework links
    These python extension modules were linked directly to a Python
    framework binary. They should be linked with -undefined dynamic_lookup
    instead of -lpython or -framework Python.
    /usr/local/opt/pykep/lib/python2.7/site-packages/PyKEP/core/_core.so
    /usr/local/opt/pykep/lib/python2.7/site-packages/PyKEP/planet/_planet.so
    /usr/local/opt/pykep/lib/python2.7/site-packages/PyKEP/sims_flanagan/_sims_flanagan.so
    /usr/local/opt/pykep/lib/python2.7/site-packages/PyKEP/util/_util.so

Here is the explanation about why it would be good if you could use the -undefined dynamic_lookup flag while linking under OS X:
http://blog.tim-smith.us/2015/09/python-extension-modules-os-x/

To control that this works well, you can use otool -L on the .so files, which should not mention any python libraries.

See https://github.com/Homebrew/homebrew-science/pull/4762 for reference. Could you please have a look at this? Thanks in advance.

Modelling a continuous thrust transfer without non-linear constraints

Good afternoon,

I have been trying to use the class lt_margo to model a continuous thrust transfer. From the answer to my previous issue, the optimisation algorithms should be able to deal with non-linear constraints for that class.

On the other hand, I have researched that evolutionary algorithms are adequate for the optimisation of continuous thrust transfers, but, from the errors I got, I believe these are not suitable to problems with non-linear constraints. In order to use, for example, Hemoglop (DE + PSO + SGA) to optimise a continuous thrust transfer, I believe a class with non-linear constraints should be used to model the problem. Could the classes direct_pl2pl, indirect_pt2pt or indirect_or2or be used to model a continuous thrust transfer without non-linear constraints? If so, which one is more adequate?

Kind regards,

Vasco

Error in example 4: planet_gtoc5 does not exist

Apparently this problem was removed in 2b118f6. Edit: Or rather, commented out.

$ python -c "import _ex4; _ex4.run_example4()"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "_ex4.py", line 104, in run_example4
    prob = mga_lt_earth_mars_sundmann(nseg=N)
  File "_ex4.py", line 18, in __init__
    from PyKEP import planet_ss, MU_SUN, AU, planet_gtoc5
ImportError: cannot import name planet_gtoc5

Building PyKEP and PyGMO (PaGMO) into the Anaconda Environment under Mac OS X

I'm attempting to build PyKEP, PyGMO (PaGMO) on a MacBook Pro running Mac OS X ver. 10.10.2 into an Anconda Python environment.

When I used the version of PyKEP obtained from git via the command git clone https://github.com/esa/pykep.git and following the installation directions at http://esa.github.io/pykep/installation.html# (for PyKEP) and http://esa.github.io/pygmo/install.html (for PyGMO) I have been able to build PyGMO and PyKEP to /urar/local/lib/python2.7/site-packages instead of /Users/user/anaconda/lib/python2.7/site-packages.

When I the version from sourceforge, http://sourceforge.net/projects/keptoolbox/files/Others/, it installs but it causes python in Anaconda to stop running giving the following error message:

                    Fatal Python error: PyThreadState_Get: no current thread
                    Abort trap: 6

Any ideas?

Please advise.

`juice_mo` throws a Runtime Error

Hello,

when trying to run pagmo and pykep for evolving the moead algorithm on the juice_mo problem, I encountered the following error:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-4-e471c5aeeb8b> in <module>
      9 algo.set_seed(trial)
     10 algo.set_verbosity(1)
---> 11 pop_1 = algo.evolve(pop_1)
     12 
     13 

~/anaconda3/envs/pagmo/lib/python3.7/site-packages/pykep/trajopt/gym/_juice.py in fitness(self, x)
     69 
     70         if self._multi_objective:
---> 71             DV, T = super().fitness(x)
     72         else:
     73             DV, = super().fitness(x)

~/anaconda3/envs/pagmo/lib/python3.7/site-packages/pykep/trajopt/_mga_1dsm.py in fitness(self, x)
    232             # s/c propagation before the DSM
    233             r, v = propagate_lagrangian(
--> 234                 r_P[i], v_out, x[8 + (i - 1) * 4] * T[i] * DAY2SEC, self.common_mu)
    235             # Lambert arc to reach Earth during (1-nu2)*T2 (second segment)
    236             dt = (1 - x[8 + (i - 1) * 4]) * T[i] * DAY2SEC

RuntimeError: Error in function boost::math::tools::bracket_and_solve_root<double>: Unable to bracket root, last nearest value was 1.6940658945086007e-21

This can be reproduced with the following few lines of code:

from pygmo import *
import pykep as pk

udp=pk.trajopt.gym.juice_mo

pop_1 = population(prob = udp, size = 100, seed = 109)
algo = algorithm(moead(gen=500, seed=109))
        
algo.set_seed(9)
pop_1 = algo.evolve(pop_1)

Is this a bug, or am I missing something?

Error building on MacOS Mojave

Hi

I can't get the project to build. Probably something with Cmake.

stjepan@carthaginian:~/Code/pykep$  ./build.sh
-- The C compiler identification is AppleClang 10.0.0.10001044
-- The CXX compiler identification is AppleClang 10.0.0.10001044
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- System name: Darwin
-- '-Wshadow': debug flag is supported by the compiler, enabling.
-- '-Werror': debug flag is supported by the compiler, enabling.
-- '-Wall': debug flag is supported by the compiler, enabling.
-- '-Wextra': debug flag is supported by the compiler, enabling.
-- '-Wnon-virtual-dtor': debug flag is supported by the compiler, enabling.
-- '-Wnoexcept': debug flag is not supported by the compiler.
-- '-Wlogical-op': debug flag is not supported by the compiler.
-- '-Wconversion': debug flag is supported by the compiler, enabling.
-- '-Wdeprecated': debug flag is supported by the compiler, enabling.
-- '-ftemplate-depth=1024': flag is supported by the compiler, enabling.
-- '-pedantic-errors': debug flag is supported by the compiler, enabling.
-- '-Wdisabled-optimization': debug flag is supported by the compiler, enabling.
-- '-fvisibility-inlines-hidden': flag is supported by the compiler, enabling.
-- '-fvisibility=hidden': flag is supported by the compiler, enabling.
-- '-ftemplate-backtrace-limit=0': debug flag is supported by the compiler, enabling.
-- '-fstack-protector-all': debug flag is supported by the compiler, enabling.
-- '-Wodr': debug flag is supported by the compiler, enabling.
-- '-Wsuggest-final-types': debug flag is not supported by the compiler.
-- '-Wsuggest-final-methods': debug flag is not supported by the compiler.
-- '-Wshift-negative-value': debug flag is supported by the compiler, enabling.
-- '-Wshift-overflow=2': debug flag is not supported by the compiler.
-- '-Wduplicated-cond': debug flag is not supported by the compiler.
-- '-Wrestrict': debug flag is not supported by the compiler.
-- '-Waligned-new': debug flag is not supported by the compiler.
-- The C++ compiler ID is: AppleClang
-- YACMA autodetected C++ flags: -ftemplate-depth=1024;-fvisibility-inlines-hidden;-fvisibility=hidden
-- YACMA autodetected C++ debug flags: -Wshadow;-Werror;-Wall;-Wextra;-Wnon-virtual-dtor;-Wconversion;-Wdeprecated;-pedantic-errors;-Wdisabled-optimization;-ftemplate-backtrace-limit=0;-fstack-protector-all;-Wodr;-Wshift-negative-value
-- Clang compiler on OSX detected, setting the standard library to 'libc++'.
-- Boost version: 1.68.0
-- Found the following Boost libraries:
--   date_time
--   serialization
-- Required Boost libraries: date_time;serialization
-- Boost version: 1.68.0
-- Found the following Boost libraries:
--   date_time
--   serialization
-- Detected Boost version: 106800
-- Boost include dirs: /usr/local/include
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/stjepan/Code/pykep/build
make: *** No rule to make target `install'.  Stop.

Examples don't work

Running Debian 9 x64. I've installed pykep and pygmo using Conda. After trying to start an example I finished getting this error:
_2018-01-30_02-19-31

Later I opened another terminal and typed there "ipcluster start":
_2018-01-30_02-36-31

Then launched example again and it seemed working at the first sight:
_2018-01-30_02-41-00

But in reality CPU load was about 0%. So what's wrong with my setup? Maybe I should build everything by myself instead of using Conda?

`TypeError` on `import pykep as pk`

I've installed pykep release 2.2 from source on Debian linux, x86_64 according to the instructions. I have pagmo and pygmo installed and can run examples in my python interpreter. When I try to test my installation by running the first example, I get the following error:

peddie@jaidee:build(tags/v2.2☠)$ ipython
Python 2.7.15 (default, May  1 2018, 05:55:50) 
Type "copyright", "credits" or "license" for more information.

IPython 5.5.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import pykep as pk
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-e89771118bdc> in <module>()
----> 1 import pykep as pk

/usr/local/lib/python2.7/dist-packages/pykep/__init__.pyc in <module>()
     46 # importing *.
     47 from pykep.core import *
---> 48 from pykep import core, sims_flanagan, pontryagin, orbit_plots, examples, phasing, util, planet, trajopt
     49 
     50 

/usr/local/lib/python2.7/dist-packages/pykep/trajopt/__init__.py in <module>()
     15     from pykep.trajopt._pl2pl_N_impulses import pl2pl_N_impulses
     16     # The open traj gym
---> 17     from pykep.trajopt._gym import gym
     18     gym = gym()
     19     # The launchers models

/usr/local/lib/python2.7/dist-packages/pykep/trajopt/_gym.py in <module>()
     86         return self.get_name()
     87 
---> 88 class gym:
     89     def __init__(self):
     90         pass

/usr/local/lib/python2.7/dist-packages/pykep/trajopt/_gym.py in gym()
     90         pass
     91     # Problem P1: Cassini MGA, single objective, direct encoding
---> 92     cassini1 = _cassini1_udp()
     93     # Problem P2: Cassini MGA, single objective, alpha encoding
     94     cassini1a =_cassini1a_udp()

/usr/local/lib/python2.7/dist-packages/pykep/trajopt/_gym.py in __init__(self)
      7 class _cassini1_udp(mga):
      8     def __init__(self):
----> 9         super(_cassini1_udp, self).__init__(
     10             seq=_seq_cassini,
     11             t0=[-1000., 0.],

TypeError: super() argument 1 must be type, not classobj

The error is identical (without source context) if I use the vanilla python interpreter in place of ipython. cmake seems to be correctly detecting my python version and so on:

peddie@jaidee:build(tags/v2.2☠)$ cmake ..
-- System name: Linux
-- The C++ compiler ID is: GNU
-- YACMA autodetected C++ flags: -fdiagnostics-color=auto;-ftemplate-depth=1024;-fvisibility-inlines-hidden;-fvisibility=hidden;-Wno-attributes
-- YACMA autodetected C++ debug flags: -Wall;-Wextra;-Wnon-virtual-dtor;-Wnoexcept;-Wlogical-op;-Wconversion;-Wdeprecated;-pedantic-errors;-Wdisabled-optimization;-ftemplate-backtrace-limit=0;-fstack-protector-all;-Wodr;-Wsuggest-final-types;-Wsuggest-final-methods;-Wshift-negative-value;-Wshift-overflow=2;-Wduplicated-cond;-Wrestrict;-Waligned-new
-- Python modules do NOT require linking to the Python library.
-- Python interpreter: /usr/bin/python
-- Python interpreter version: 2.7.15
-- Python include dir: /usr/include/python2.7
-- Generic UNIX platform detected.
-- Python modules install path: lib/python2.7/dist-packages
-- Boost version: 1.62.0
-- Found the following Boost libraries:
--   date_time
--   serialization
-- Required Boost libraries: date_time;serialization;python
-- Boost version: 1.62.0
-- Found the following Boost libraries:
--   date_time
--   serialization
--   python
-- Detected Boost version: 106200
-- Boost include dirs: /usr/include
-- Setting up the compilation of the Python module '_core'.
-- Setting up extra compiler flag '-fwrapv' for the Python module '_core'.
-- Python < 3 detected, setting up extra compiler flag '-fno-strict-aliasing' for the Python module '_core'.
-- Setting up the compilation of the Python module '_planet'.
-- Setting up extra compiler flag '-fwrapv' for the Python module '_planet'.
-- Python < 3 detected, setting up extra compiler flag '-fno-strict-aliasing' for the Python module '_planet'.
-- Setting up the compilation of the Python module '_sims_flanagan'.
-- Setting up extra compiler flag '-fwrapv' for the Python module '_sims_flanagan'.
-- Python < 3 detected, setting up extra compiler flag '-fno-strict-aliasing' for the Python module '_sims_flanagan'.
-- Setting up the compilation of the Python module '_util'.
-- Setting up extra compiler flag '-fwrapv' for the Python module '_util'.
-- Python < 3 detected, setting up extra compiler flag '-fno-strict-aliasing' for the Python module '_util'.
-- Creating the files for the generation of a binary wheel.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/peddie/software/numerical/pykep/build

What am I doing wrong? What must I do to run the examples?

Happy to provide any additional information that can help debug.

clock_gettime undeclared on Windows builld

When compiling on Windows 7 with VS2015 I was getting an error that clock_gettime was undefined in datetime.h

To fix it I had to add the following code:

#ifdef WIN32
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif



#ifdef WIN32
#define CLOCK_REALTIME 0
    struct timespec { long tv_sec; long tv_nsec; };    //header part
    static int clock_gettime(int, struct timespec *spec)      //C-file part
    {
        __int64 wintime; GetSystemTimeAsFileTime((FILETIME*)&wintime);
        wintime -= 116444736000000000i64;  //1jan1601 to 1jan1970
        spec->tv_sec = wintime / 10000000i64;           //seconds
        spec->tv_nsec = wintime % 10000000i64 * 100;      //nano-seconds
        return 0;
    }
#endif

Problems compiling Pykep on OSX

Hello,

I'm hitting problems compiling Pykep on OSX; I've seen someone reporting similar looking error messages but the error in that case seemed to be inconsistent Python version information in cmake. I don't think that's the case here, but I'm not an expert in cmake; can anyone suggest what the issue is?

Summary: I have installed boost and boost-python version 1.64 using Homebrew. This seems to be picked up OK in cmake. I'm using OSX 10.12.4, with Xcode V8.0. I downloaded the Pykep source using git clone.

I've tried the OSX "native" Python 2.7, and also a separate Python 2.7 installed via Anaconda - same results.

Here is the output from my cmake configuration:

-- OS detected: Darwin
-- CXX Compiler detected: AppleClang
-- CMake additional search path for libraries: /usr/local/lib
-- Enabling '-std=c++11' compiler flag
-- Enabling '-fPIC' compiler flag
-- CXX compilation flags:  -std=c++11
-- C compilation flags:  -fPIC
-- Python interpreter: /Users/nigelbannister/anaconda/bin/python
-- Python interpreter verison: 2.7
-- Python includes path: /Users/nigelbannister/anaconda/include/python2.7
-- Python modules install path: /Users/nigelbannister/anaconda/lib/python2.7/site-packages
-- Python library name: /Users/nigelbannister/anaconda/lib/libpython2.7.dylib
-- Required Boost libraries: serialization;date_time;python
-- Boost version: 1.64.0
-- Found the following Boost libraries:
--   serialization
--   date_time
--   python
-- Detected Boost version: 106400
-- Boost include dirs: /usr/local/include
-- Boost libraries: /usr/local/lib/libboost_serialization-mt.dylib;/usr/local/lib/libboost_date_time-mt.dylib;/usr/local/lib/libboost_python-mt.dylib
-- Creating the files for the generation of a manylinux binary wheel.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/nigelbannister/pykep

When I then run make, I receive a lot of output containing numerous errors including "no member named 'serialize' and others. I've copied a section of the output below.

host-163-147:build nigelbannister$ make
[  0%] Building CXX object src/CMakeFiles/keplerian_toolbox_static.dir/planet/keplerian.cpp.o
In file included from /Users/nigelbannister/pykep/src/planet/keplerian.cpp:30:
In file included from /Users/nigelbannister/pykep/src/planet/keplerian.h:32:
In file included from /Users/nigelbannister/pykep/src/planet/base.h:32:
In file included from /Users/nigelbannister/pykep/src/planet/../epoch.h:35:
In file included from /Users/nigelbannister/pykep/src/planet/../serialization.h:30:
In file included from /usr/local/include/boost/archive/binary_iarchive.hpp:20:
In file included from /usr/local/include/boost/archive/binary_iarchive_impl.hpp:20:
In file included from /usr/local/include/boost/archive/basic_binary_iprimitive.hpp:53:
In file included from /usr/local/include/boost/serialization/array_wrapper.hpp:19:
In file included from /usr/local/include/boost/serialization/nvp.hpp:26:
In file included from /usr/local/include/boost/serialization/split_member.hpp:23:
/usr/local/include/boost/serialization/access.hpp:116:11: error: no member named 'serialize' in 'boost::array<double, 3>'
        t.serialize(ar, file_version);
        ~ ^
/usr/local/include/boost/serialization/serialization.hpp:68:13: note: in instantiation of function template specialization
      'boost::serialization::access::serialize<boost::archive::binary_iarchive, boost::array<double, 3> >' requested here
    access::serialize(ar, t, static_cast<unsigned int>(file_version));
            ^
/usr/local/include/boost/serialization/serialization.hpp:126:5: note: in instantiation of function template specialization
      'boost::serialization::serialize<boost::archive::binary_iarchive, boost::array<double, 3> >' requested here
    serialize(ar, t, v);
    ^
/usr/local/include/boost/archive/detail/iserializer.hpp:188:27: note: in instantiation of function template specialization
      'boost::serialization::serialize_adl<boost::archive::binary_iarchive, boost::array<double, 3> >' requested here
    boost::serialization::serialize_adl(
                          ^
/usr/local/include/boost/serialization/singleton.hpp:136:47: note: in instantiation of member function
      'boost::archive::detail::iserializer<boost::archive::binary_iarchive, boost::array<double, 3> >::load_object_data' requested here
        static detail::singleton_wrapper< T > t;
                                              ^
/usr/local/include/boost/serialization/singleton.hpp:149:16: note: in instantiation of member function
      'boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::binary_iarchive, boost::array<double, 3> >
      >::get_instance' requested here
        return get_instance();
               ^
/usr/local/include/boost/archive/detail/iserializer.hpp:414:20: note: (skipping 18 contexts in backtrace; use
      -ftemplate-backtrace-limit=0 to see all)
                >::get_const_instance()
                   ^
/usr/local/include/boost/serialization/export.hpp:66:12: note: in instantiation of member function
      'boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binary_iarchive,
      kep_toolbox::planet::keplerian> >::get_const_instance' requested here
        >::get_const_instance();
           ^
/usr/local/include/boost/serialization/export.hpp:105:40: note: in instantiation of member function
      'boost::archive::detail::export_impl<boost::archive::binary_iarchive, kep_toolbox::planet::keplerian>::enable_load' requested here
    export_impl<Archive,Serializable>::enable_load(
                                       ^
/usr/local/include/boost/serialization/export.hpp:92:37: note: in instantiation of member function
      'boost::archive::detail::ptr_serialization_support<boost::archive::binary_iarchive, kep_toolbox::planet::keplerian>::instantiate'
      requested here
        &ptr_serialization_support::instantiate
                                    ^
/usr/local/include/boost/serialization/export.hpp:133:9: note: in instantiation of member function
      'boost::archive::detail::extra_detail::guid_initializer<kep_toolbox::planet::keplerian>::export_guid' requested here
        export_guid(boost::serialization::is_abstract< T >());
        ^
/Users/nigelbannister/pykep/src/planet/keplerian.cpp:169:1: note: in instantiation of member function
      'boost::archive::detail::extra_detail::guid_initializer<kep_toolbox::planet::keplerian>::export_guid' requested here
BOOST_CLASS_EXPORT_IMPLEMENT(kep_toolbox::planet::keplerian);
^
/usr/local/include/boost/serialization/export.hpp:158:35: note: expanded from macro 'BOOST_CLASS_EXPORT_IMPLEMENT'
        >::get_mutable_instance().export_guid();             \
                                  ^
In file included from /Users/nigelbannister/pykep/src/planet/keplerian.cpp:30:
In file included from /Users/nigelbannister/pykep/src/planet/keplerian.h:32:
In file included from /Users/nigelbannister/pykep/src/planet/base.h:32:
In file included from /Users/nigelbannister/pykep/src/planet/../epoch.h:35:
In file included from /Users/nigelbannister/pykep/src/planet/../serialization.h:30:
In file included from /usr/local/include/boost/archive/binary_iarchive.hpp:20:
In file included from /usr/local/include/boost/archive/binary_iarchive_impl.hpp:20:
In file included from /usr/local/include/boost/archive/basic_binary_iprimitive.hpp:53:
In file included from /usr/local/include/boost/serialization/array_wrapper.hpp:19:
In file included from /usr/local/include/boost/serialization/nvp.hpp:26:
In file included from /usr/local/include/boost/serialization/split_member.hpp:23:
/usr/local/include/boost/serialization/access.hpp:116:11: error: no member named 'serialize' in 'boost::array<double, 6>'
        t.serialize(ar, file_version);

There's much more output afterwards but it all seems to be complaining about the same basic issues.

Any pointers to potential solutions would be welcome!

Regards

Nigel

Error when calling SLSQP with Example 7

I am attempting to run example 7. When I run the following code:

import pykep as pk
pk.examples.run_example7(solver = "slsqp")

I receive the following error.

ValueError                                Traceback (most recent call last)
<ipython-input-2-10802c6cd609> in <module>()
----> 1 pk.examples.run_example7(solver = "slsqp")

/home/aharden/anaconda3/lib/python3.6/site-packages/pykep/examples/_ex7.py in run_example7(solver)
     60 
     61     # 4 - Solve the problem (evolve)
---> 62     pop = algo.evolve(pop)
     63 
     64     # 5 - Inspect the solution

ValueError: 
function: nlopt_objfun_wrapper
where: /usr/local/include/pagmo/algorithms/nlopt.hpp, 412
what: during an optimization with the NLopt algorithm 'slsqp' an objective function gradient was requested, but the optimisation problem '<class 'pykep.examples._ex_utilities.add_gradient'>' does not provide it

I am running on Windows 10 with the latest version of Anaconda installed (both python 3.6 and 3.7).

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.