bsk轨道设计

仿真容器,进程,任务,航天器,引力。

基本轨道设计

    #   setup orbit and simulation time
    #
    # setup the orbit using classical orbit elements
    oe = orbitalMotion.ClassicElements()
    # 创建了一个轨道元素对象oe,用于存储轨道的参数。
    rLEO = 7000. * 1000      # meters
    rGEO = 42000. * 1000     # meters
    if orbitCase == 'GEO':
        oe.a = rGEO
        oe.e = 0.00001
        oe.i = 0.0 * macros.D2R
    elif orbitCase == 'GTO':
        oe.a = (rLEO + rGEO) / 2.0
        oe.e = 1.0 - rLEO / oe.a
        oe.i = 0.0 * macros.D2R
    else:                   # LEO case, default case 0
        oe.a = rLEO
        oe.e = 0.0001
        oe.i = 33.3 * macros.D2R
    # 设置轨道的半长轴(a)、偏心率(e)和轨道倾角(i)。
    oe.Omega = 48.2 * macros.D2R
    oe.omega = 347.8 * macros.D2R
    oe.f = 85.3 * macros.D2R
    # 设置了轨道的平近点角(Omega)、升交点赤经(omega)和真近点角(f)。
    # 这些角度的单位是弧度,macros.D2R是一个宏,用于将度转换为弧度。
    rN, vN = orbitalMotion.elem2rv(mu, oe)
    oe = orbitalMotion.rv2elem(mu, rN, vN)
    # 轨道元素(oe)和万有引力常数(mu)计算轨道的位置(rN)和速度(vN)。
    # this stores consistent initial orbit elements
    # with circular or equatorial orbit, some angles are arbitrary

航天器初始化

    scObject.hub.r_CN_NInit = rN  # m   - r_BN_N
    scObject.hub.v_CN_NInit = vN  # m/s - v_BN_N
    # set the simulation time
    # 天体运动的模拟时间,轨道周期
    n = np.sqrt(mu / oe.a / oe.a / oe.a)#轨道周期的倒数,开普勒第三定律。
    P = 2. * np.pi / n #周期
    if useSphericalHarmonics: #球谐函数
        simulationTime = macros.sec2nano(3. * P)
    else:
        simulationTime = macros.sec2nano(0.75 * P)

    # Setup data logging before the simulation is initialized
    if useSphericalHarmonics:
        numDataPoints = 400
    else:
        numDataPoints = 100
   
	samplingTime = unitTestSupport.samplingTime(simulationTime, 			   simulationTimeStep, numDataPoints)
    # create a logging task object of the spacecraft output message at 			   #the desired down sampling ratio
    dataRec = scObject.scStateOutMsg.recorder(samplingTime)
    scSim.AddModelToTask(simTaskName, dataRec)

可视化

初始化

结束时间

执行

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值