Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

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.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M91719580
  • Price:- $150

Priced at Now at $150, Verified Solution

Have any Question?


Related Questions in C/C++

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As