Components of the position and velocity vectors

Assignment Help C/C++ Programming
Reference no: EM131003832

I want the solution for assignment in c++ and also I want graph in Matlab with coding

Ensuring the proper orbital insertion for a satellite is critical if the satellite is to function as intended. While space scientists learn a great deal about orbital mechanics, it is also important for aerospace engineers to have an understanding of the basics. In fact, you will learn these basics when you take MAE 4263Space Flight Mechanics.

As an introduction to orbital mechanics, you will be focusing on planetary orbits for this project. Elementary orbital mechanics begins with the study of the two-body problem, in which it is assumed that there are only two masses in the universe, with one orbiting about the other. In this case, orbital motion is described by the following ordinary differential equation:

r = d2r/dt2 = -(G(M + m)/r2).(r/r) = -(G(M + m)/r3)r

where ris the vector between the two bodies, ris the acceleration vector, M and m are the masses of the two bodies, and G is the universal gravitational constant. This equation may be expanded into four equations so as to be able to calculate the velocity of the orbiting body:

drx/dt = vx, dry/dt = vy

dvx/dt = -G(M + m)rx/r3, dvy/dt = -G(M + m)ry/r3

where rx, ry, vx are the x- and y- components of the position and velocity vectors, respectively.

You are to solve these equations using the 4th-order Runge-Kutta scheme. You must write a computer program that accepts as input the aphelion (farthest) distance the planet is from the sun in astronomical units (AU), the eccentricity of the orbit, , and how many orbits, 0 ≤ e ≤ 1 are to be calculated. With the help of the equations on the back, your code will solve the four ODEs above, plotting the position of the orbiting body (starting at the aphelion) as a function of time as it orbits counterclockwise about the sun.

Your code should continue until a user-specified number of orbital periods (i.e. complete orbits) have been calculated. The time increment you use should be equal to 0.01 years. Also, when using the units of AU and years, G(M + m) = μ = 4Π2 irrespective of the masses of the planetary bodies involved. Note that the position of the aphelion should be along the negative x-axis, and the initial velocity should only be in the negative y direction.

Case 1: ra = 1.01671 AU, e = 0.0167 (Earth)
Case 2: ra = 1.666 AU, e = 0.0934 (Mars)
Case 3: ra = 35.100 AU, e = 0.967 (Halley's Comet, Dec. 2023)
Case 4: ra = 27.530 AU, e = 0.744 (Some random asteroid I made up)

where ra is the radius of aphelion. For each of these cases, compute and plot a single orbit.

Plot each orbit on its own graph. Be sure to scale your axes equally to see the true shape of the orbits. Also put a small symbol at (x,y) = (0,0) to denote the sun. Make sure axes have labels, the plot has a title, and that you use all other good plotting techniques.

Up to 10% Extra Credit: We have all heard the expression that "the gravitational force between two bodies is inversely-proportional to the distance between them squared." This is embodied in the governing ODE above, and dictates the motion of the planets and other orbiting bodies. But what if the laws of physics were different? What if the force weren't inversely-proportional to the distance squared, but instead to the distance raised to the 2.1 power? How would planets orbit the sun then? As extra credit, modify your code to explore these fantasy physics. Using the same data above for the asteroid's orbit (case 4), plot 6 periods of the new orbit for the asteroid if the force were inversely-proportional to the distance raised to the 2.1 power. Considering the number of data points this will generate, you may want to increase the time step to 0.1 years from 0.01 years for this problem only.

You may choose any computer language you prefer for your code provided you are not using a commercial or other pre-written application to do the work for you (MATLAB, Mathematica, Excel, and other available software are not acceptable). The plots may be created by importing your data into any available software. While working in small groups to set up the problem and determine how to solve it is acceptable, all code must be original work. Code that is copied or substantially similar to other students' work (past or present) will be rejected and no credit for the assignment received.

To complete this project, you must turn in both a hard copy of the code listing, the plots, and numeric values for rx, ry, vx, and vy for Case 1 (only) out to exactly six decimal places for each iteration using all proper formatting techniques for tabulated data. Everything must also be submitted electronically on Canvas. Please do not email your assignment to me. This project must be turned in by the end of class on the due date to receive credit. No late assignments will be accepted.

Reference no: EM131003832

Questions Cloud

Find the average cost per camera : Estimate the marginal cost at production level x = 5500. Find the actual cost C (5501) - C (5500). Find the average cost per camera at x = 5500. (Round your answer to three decimal places.)
What can you conclude about the indices of refraction : Light goes from material having a refractive index of n1 into a material with refractive index n2. If the refracted light is bent away from the normal, what can you conclude about the indices of refraction?
Identify the aspects of character education : Identify the aspects of character education clearly communicated through the text. What content of character education would be well taught with this text?
Find the maximum index that the liquid may have : Light is incident normally on the short face of a 30o - 60o -90o prism (shown in the figure below). A drop of liquid is placed on the hypotenuse of the prism. If the index of the prism is 1.69, find the maximum index that the liquid may have if the..
Components of the position and velocity vectors : This is embodied in the governing ODE above, and dictates the motion of the planets and other orbiting bodies. But what if the laws of physics were different? What if the force weren't inversely-proportional to the distance squared, but instead to..
Make to mycp to produce new program : What happens to mycp if one or more of the files to be copied doesn't exist? Can you make any suggestions to better handle the situation?. Write a program called mymv that does with the mv command what mycp does with the cp command. How many changes ..
How much of a sample weighing eight gram will remain : The half-life of plutonium-241 is approximately 13 years. How much of a sample weighing 8 g will remain after 90 years? How much time is necessary for a sample weighing 8 g to decay to 0.1 g?
Find the intensity of the incident beam of light : Light that passes through a series of three polarizing filters emerges from the third filter horizontally polarized with an intensity of 200 W/m2. If the polarization angle between the filters increases by 25o from one filter to the next, find the..
A navigation bar or menu : This is the first step of a project so pretty basic. The idea I submitted my project will be about is about recording and tracking rental property's data (rental payments and bills  1. One page is the Home page (or default) and should contain the inf..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd