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-1.0.0-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-1.0.0-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-1.0.0-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-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ncorpos_vi_py-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c9372618f5b4f2a04825600f5abc7a93a99355c3cc5772e1f06182f437c91429
MD5 c9896307830d683b819471eb728038fc
BLAKE2b-256 89c1436bdb6dc907fc222baf337618c4acee5fa8f8c8d62c28a8e0d1857f1d2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ncorpos_vi_py-1.0.0-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-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ncorpos_vi_py-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c45ac05553cc0774d97711585af21093ff355620e3e0911df1177748be631a00
MD5 904c198a3dde698c8d6a2c7b463e1cfd
BLAKE2b-256 342072ae70d04769181d6875687f4ce29830dc2fdd56cdcf560d5ba179e70d4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ncorpos_vi_py-1.0.0-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-1.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ncorpos_vi_py-1.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2955b6e22b309d381306013f1691823b931756a15b80f2cbc60217c893e9ccbe
MD5 dbaffbdc626c68af4440f896d63e1e74
BLAKE2b-256 e62aad42a59a136f8981f830abf22dfaed22abe9c91b2005b0b91ba3c6d7838b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ncorpos_vi_py-1.0.0-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