Skip to main content

Geracao de valores iniciais via Fortran

Project description

ncorpos-vi-py

Um binding para Python da biblioteca em fortran ncorpos-vi, utilizada no gravidade-fortran.

Permite a geração de valores iniciais para problema de N-corpos e o seu condicionamento para constantes de movimento específicas.

Uso

No momento, o pacote providencia uma única classe Gerador, cuja inicialização recebe os parâmetros:

  • N: Quantidade de corpos (integer);
  • G: Constante de gravitação universal (float). Por padrão, G=1.0;
  • eps: Amortecedor para o potencial (float). Por padrão, eps=0.0;
  • modo: Modo de sorteio. Modos disponíveis:
    • sorteio: Apenas sorteia, sem condicionar;
    • sorteio_ip_iterativo: Sorteia e condiciona as integrais primeiras via método iterativo;
    • sorteio_ip_direto: Sorteia e condiciona as integrais primeiras via método direto;
    • sorteio_aarseth: Sorteia e condiciona as integrais primeiras conforme proposto por (Aarseth, 2003), forçando $E=-0.25$, $J = 0$, $P=0$ e com $2T = - V$ no instante inicial;
    • sorteio_aarseth_modificado: Igual ao sorteio_aarseth se eps=0.0, mas implementa um método iterativo para obter o equilíbrio inicial quando eps!=0.0.
  • energia: Valor da energia total desejada. Por padrão, energia=0.0.
  • angular: Valor do momento angular total desejada. Por padrão, angular=[0.0,0.0,0.0].
  • linear: Valor do momento linear total desejada. Por padrão, linear=[0.0,0.0,0.0].

Exemplo de uso:

>>> import ncorpos_vi

>>> G = ncorpos_vi.Gerador(N=10, modo="sorteio_ip_direto")

Isso instancia a classe. É possível re-instanciar usando a função configurar, que recebe os mesmos parâmetros do inicializador. Não modifique as variáveis diretamente na classe, pois isso não funcionará!

Exemplo de geração de valores iniciais:

>>> G.gerar()
Gerando valores iniciais com as seguintes configuracoes: 
N = 10 / G = 1.0 / eps = 0.0 / modo = sorteio_ip_direto
Constantes de movimento: E = 0.0 / J = [0.0, 0.0, 0.0] / P = [0.0, 0.0, 0.0]

Massas:
 - intervalo = [1.0, 1.0]
 - normalizadas = False

Posicoes:
 - distribuicao = uniforme
 - regiao = cubo
 - intervalo = [-10.0, 10.0]

Momentos lineares:
 - distribuicao = uniforme
 - regiao = cubo
 - intervalo = [-1.0, 1.0]

GERACAO DAS VALORES INICIAIS (sorteio_ip_direto)
  > gerando valores...
    * gerando massas
    * gerando posicoes (uniforme)
    * gerando momentos (uniforme)
 
  > condicionando...
    > coeficientes:
      * alpha =   1.0000000000000000     
      * beta  =   1.2544283054674359     
      * S1    =   3.2290389342212205     
      * S2    =   0.0000000000000000     
      * T.I.  =   588.96154068688691        393.72305489257315        437.72817364181810     
      * Autovalores (T.I.):    314.89279495786678        506.12642349964420        599.39355076376728     
 
  > valores iniciais condicionados!
      * V   =   -5.0811845827341813     
      * T   =    5.0811845827341831     
      * E   =    1.7763568394002505E-015
      * Vir =    5.0811845827341848     
      * J   =    3.9968028886505635E-015  -1.7763568394002505E-015  -5.5511151231257827E-015
      * P   =   -2.2204460492503131E-016  -1.6653345369377348E-016   2.6454533008646308E-016
      * I   =    710.20638461063891     
      * D   =   -30.363431913548109     
      * A_I =   0.31904518875470239     
      * MD  =    11.523791095116417 

Referências

  • AARSETH, Sverre. Gravitational N-Body Simulations: Tools and Algorithms. Cambridge: Cambridge University Press, 2003.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ncorpos_vi_py-0.0.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

ncorpos_vi_py-0.0.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (15.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

ncorpos_vi_py-0.0.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (15.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file ncorpos_vi_py-0.0.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ncorpos_vi_py-0.0.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 88b39f39403b7076db2c2e68eac93d5c9bdf9397f9bb41f1ec0758d551a80fe3
MD5 a343a141e1ab86040713376bda1767c8
BLAKE2b-256 4c741252ea8509d06ab12dd2e2cb21a49556d680ffa78ae4f1165ce7547c81e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ncorpos_vi_py-0.0.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi.yml on Potalej/ncorpos-vi-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ncorpos_vi_py-0.0.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ncorpos_vi_py-0.0.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c56319d8b184f21d7cc87d573b503e62f31df8e43b86d2e4139e77f27c43dd38
MD5 7e41d5cb23128e1366437f7b21a71fab
BLAKE2b-256 88ed0b136ec115bd27f7a1e0289a4afa1c919a1672f7e6ceace7bf02593dafbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for ncorpos_vi_py-0.0.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi.yml on Potalej/ncorpos-vi-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ncorpos_vi_py-0.0.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ncorpos_vi_py-0.0.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c65e79cd408e9e09599954f22ff6153b5060f9b0783f5cfde3b1bed68b96bbcc
MD5 f365ac5ba088d237fc604c9ff328a188
BLAKE2b-256 8189d57c0772375f04925b0108d5394947a49df0c36f3b0b4e6d3fc06695c81b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ncorpos_vi_py-0.0.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi.yml on Potalej/ncorpos-vi-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page