Giter Site home page Giter Site logo

project's Introduction

Document

总述

核心文件如下:const.py, calculator.py

const.py 文件里放置了需要的常数和与之密切相关的两个函数

calculator.py 文件里有两个类,第一个是Methods,里面都是用于课题的一般性函数,即比较基础性的函数;第二个是Calculator,这个类里的函数都是复合型函数,用以利用Methods里的函数得到相关的数据和图。

Data.xlsx 是没有加入磁场时得到的数据,包括M_p(总质量)、L_s(外边界光度)、ST($\frac{\mathrm{d} S}{\mathrm{d} T}$)和t,读取后(读取函数在Calculator中,具体在后面介绍)可以绘制出时间演化的图像。

其他文件都是用来测试的或得到的图像文件,还有一些工程文件之类的,价值不大。

文件函数详解

const.py

cal_const: 求出迭代方程中所需要的常数

set_M_p: 由于不同的总质量导致迭代半径不同,每次修改总质量进行相关计算时需要调用此函数。

calculator.py

Methods

ode_fun: 没有加入磁场时的odeint迭代函数

ode_fun_B: 加入磁场后的odeint迭代函数(注意:这两个函数中都进行了无量纲修正,其中,M/M_e,P/P_0,T/T_0,R/R_B.然后L则是以1e+24 erg/s为单位)(方程直接使用Huang那一篇的方程)

cal_ML_simple: 没有加入磁场时计算吸积盘结构的核心程序

cal_ML_simple_B: 加入磁场后的计算吸积盘结构的核心程序

sigma: 求解考虑磁场后的电导率的函数

cal_L_safe: 之前因为求解过程中L的值比较敏感所设置的函数,如今依旧有用,但复杂度大大下降了,在后面的牛顿迭代核心函数中有用

grad: 计算梯度的函数

find_L_M: 牛顿迭代核心函数,通过选取L_s、ST得到所需的内边界的L_in和M.在无磁场情况下两组量解耦,故使用复合的一维牛顿迭代。尚未建立在磁场情况下的迭代函数,因为微分方程本身的变化尚未明朗

change_const: 辅助函数,直接修改Methods方法附带的Const类

find_safe_point: 之前因为求解过程中L的值比较敏感所设置的“机器学习”函数,如今用处不大

Calculator

cal_M_range: 给定一个M_p的范围,得到该范围内每个切片的结构情况,其中的ST数据可以用来进行时间演化方面的计算。尚未考虑磁场。

creat_t: 创建相对应的时间数组。

creat_data: 最近为了得到更大范围的M_p所构建的函数,可以得到给定范围内的时间演化情况,并输出相关数据到Excel和png图像

cal_g_in: 因为曹成业之前设想在内边界固定一个非零的g值(因为目前没法使得内边界g为0,所以退而求其次固定一个非零的g值)

write_excel: 将计算求得的函数按照一定格式输出到Excel

read_excel: 与上一个函数互为补充,将同样格式的数据导入到内存中

目前情况

目前已经解决了无磁场状况,但加入磁场后依旧停留在计算切片的过程中,甚至连牛顿迭代都还没开始。目前困境是不知为何出现不了在内、外边界g均为0的情况,同时不知能否通过L_s、ST、dg($\frac{\part g}{\part r}$)三个量得到符合条件的M、L_in、g_in.

project's People

Contributors

hellogithubc avatar

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.