Cody

Problem 45797. SatCom #5: Determine Elliptical Orbit Parameters

Solution 3159916

Submitted on 11 Oct 2020 by Rafael S.T. Vieira
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%International Space Station apogee = 381; perigee = 372; y_correct = [6747.5 6747.498499444 6.669136717302705e-04]; [semimaj, semimin, ecc] = orbit_ellipse(apogee, perigee) assert(abs(semimaj-y_correct(1))<0.000001,'Semi-major axis wrong') assert(abs(semimin-y_correct(2))<0.000001,'Semi-minor axis wrong') assert(abs(ecc-y_correct(3))<0.000001,'Eccentricity wrong')

semimaj = 6.7475e+03 semimin = 6.7475e+03 ecc = 6.6691e-04

2   Pass
%Molnya Orbit apogee = 39700; perigee = 600; y_correct = [26521 1.792096372966588e+04 0.737151691112703]; [semimaj, semimin, ecc] = orbit_ellipse(apogee, perigee) assert(abs(semimaj-y_correct(1))<0.000001,'Semi-major axis wrong') assert(abs(semimin-y_correct(2))<0.000001,'Semi-minor axis wrong') assert(abs(ecc-y_correct(3))<0.000001,'Eccentricity wrong')

semimaj = 26521 semimin = 1.7921e+04 ecc = 0.7372

3   Pass
%Orbit of the Moon around the Earth apogee = 405400; perigee = 362600; y_correct = [390371 3.897839884359028e+05 0.054819645926567]; [semimaj, semimin, ecc] = orbit_ellipse(apogee, perigee) assert(abs(semimaj-y_correct(1))<0.000001,'Semi-major axis wrong') assert(abs(semimin-y_correct(2))<0.000001,'Semi-minor axis wrong') assert(abs(ecc-y_correct(3))<0.000001,'Eccentricity wrong')

semimaj = 390371 semimin = 3.8978e+05 ecc = 0.0548

4   Pass
%Circular Geostationary Orbit apogee = 35793; perigee = 35793; y_correct = [42164 42164 0]; [semimaj, semimin, ecc] = orbit_ellipse(apogee, perigee) assert(abs(semimaj-y_correct(1))<0.000001,'Semi-major axis wrong') assert(abs(semimin-y_correct(2))<0.000001,'Semi-minor axis wrong') assert(abs(ecc-y_correct(3))<0.000001,'Eccentricity wrong')

semimaj = 42164 semimin = 42164 ecc = 0

5   Pass
s=importdata('orbit_ellipse.m'); y_correct=false; assert(isequal(sum(contains(s,'regexp')),y_correct))

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!