Tudat / tudat

NOTE: This Tudat version is no longer supported. See https://docs.tudat.space/en/stable/ and https://github.com/tudat-team/tudat-bundle for the new version
BSD 3-Clause "New" or "Revised" License
87 stars 143 forks source link

Warning when using radiation pressure with multiple occulting bodies #655

Closed Nosudrum closed 2 years ago

Nosudrum commented 4 years ago

Hello,

I am trying to use the json interface to find the eclipse situations for a spacecraft in orbit around the Earth.

In my main.json file (attached here as a txt) I have setup the solar radiation pressure to include the Earth and Moon as occulting bodies. When I run the application with either the Earth or the Moon alone everything works fine, but when I include them both I get the following message for each epoch when I run the simulation : "Warning, multiple occultation occured in radiation pressure interface, results may be slightly in error"

Could you please let me know how I can prevent this from happening ?

Thanks a lot for your help. Sincerely,

Arnaud Muller

main.txt

DominicDirkx commented 4 years ago

Hi Arnaud,

The error you're getting is due to the fact that you've defined several 'occulting bodies' (Earth and Moon) for your radiation pressure. The algorithm to compute the total shadowing on your spacecraft is not yet implemented. So, the short (and most likely unsatisfying) answer yo your question is: to prevent this problem either use a sinlge occulting body, or implement the model for multiple occulting bodies (with our help when it comes to code integration)

It may also interest you to know that we are working on a completely revised tudat installation and interface. The interface will be only a few lines using a tool called 'conda', with all the code precompiled for you. The code interfaces will be modified and most importantly will now come with a Python interface for Tudat! The first release of this new Tudat will happen by mid-November

Best,

Dominic

Nosudrum commented 4 years ago

Hello Dominic, thank you for your answer !

I understand the limitation for the occulting model and will see on my side if running the simulation with a single body is fine.

I also look forward to the new tudat installation and interface ! Hopefully it'll be as easy to use as the json interface !

Nosudrum commented 4 years ago

Hello @DominicDirkx,

I have encountered another unrelated issue : when I run the main.json file (contents in the main.txt file attached), I get the following error in the command window : "terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 1) >= this->size() (which is 1)"

The application output only says "json_interface.exe exited with code 3", but does not give any indication about the potential location of the issue in the code.

Would you have any idea ?

Thanks a lot for your help.

Best,

Arnaud Muller

main.txt

DominicDirkx commented 4 years ago

It would seem that the number of propagated bodies and number of central bodies is not equal. This is likely causing your issue

Nosudrum commented 4 years ago

@DominicDirkx I have set "centralBodies" to ["Earth","Earth"] to match the number of propagated bodies and it seems to work, although I get two "unused key" messages in the command window :

Dependent variables being saved, output vectors contain:
Vector entry, Vector contents
0, Kepler elements of CHESS1 w.r.t. Earth
6, Kepler elements of CHESS2 w.r.t. Earth
12, Radiation pressure of CHESS1 w.r.t. Sun
13, Radiation pressure of CHESS2 w.r.t. Sun
Unused key: export[2].variables[0].body
Unused key: export[3].variables[0].body
Press <RETURN> to close this window...

Is this normal ?

Thanks a lot for your help !

DominicDirkx commented 4 years ago

Without going into your files, first check: what is inside export[2].variables[0].body and export[3].variables[0].body. Is it something you expect to be used?

Nosudrum commented 4 years ago

It was the state type which already includes the state of all bodies, so the body key was useless. I've edited my json file to only export a single state file and it all works as expected now.

Thanks a lot for your help !!

DominicDirkx commented 2 years ago

NOTE: This Tudat version is no longer supported. See https://docs.tudat.space/en/stable/ and https://github.com/tudat-team/tudat-bundle for the new version