Question

6. [20 points] The following nonlinear differential equations describe the motion of a body in orbit around two much heavier

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER:

Here I'm writing the code

Code:

odefunc.m

function dydt = odefunc(t,a)
mu = 1/82.45;
mu_ = 1-mu;
r1 = sqrt((a(1)+mu)^2 + a(2)^2);
r2 = sqrt((a(1)-mu_)^2 + a(2)^2);
dydt = [a(3);
a(4);
2*a(4) + a(1) - mu_*(a(1)+mu)/(r1^3) - mu*(a(1)-mu_)/(r2^3);
-2*a(3) + a(2) - mu_*a(2)/(r1^3) - mu*a(2)/(r2^3)];
end

odefunc_half.m

function dydt = odefunc_half(t,a)
mu = 1/82.45;
mu_ = 1-mu;
r1 = sqrt((a(1)+mu)^2 + a(2)^2);
r2 = sqrt((a(1)-mu_)^2 + a(2)^2);
dydt = [a(3);
a(4);
a(4) + a(1) - mu_*(a(1)+mu)/(r1^3) - mu*(a(1)-mu_)/(r2^3);
-a(3) + a(2) - mu_*a(2)/(r1^3) - mu*a(2)/(r2^3)];
end

odefunc_double.m

function dydt = odefunc_double(t,a)
mu = 1/82.45;
mu_ = 1-mu;
r1 = sqrt((a(1)+mu)^2 + a(2)^2);
r2 = sqrt((a(1)-mu_)^2 + a(2)^2);
dydt = [a(3);
a(4);
4*a(4) + a(1) - mu_*(a(1)+mu)/(r1^3) - mu*(a(1)-mu_)/(r2^3);
-4*a(3) + a(2) - mu_*a(2)/(r1^3) - mu*a(2)/(r2^3)];
end

code.m

close all
clear
clc

T = 6.19216933;
ic = [0;
-1.04935751;
-1.84;
0];
mu = 1/82.45;
mu_ = 1-mu;

options = odeset('RelTol', 1e-6);
[TIME,Z] = ode45(@odefunc, [0,2*T], ic, options);
figure, plot(Z(:,1),Z(:,2)); hold on
scatter(mu_,0), scatter(-mu,0);
legend('show');
legend('Orbit', 'Moon', 'Earth')
axis([-1.5 1.5 -1.5 1.5]); axis equal, grid on;
title('y(x)');

[TIME,Z] = ode45(@odefunc_half, [0,2*T], ic, options);
figure, plot(Z(:,1),Z(:,2)); hold on
scatter(mu_,0), scatter(-mu,0);
legend('show');
legend('Orbit', 'Moon', 'Earth')
grid on;
title('y(x) (Half the initial velocity)');
% Note that the axis is not same as other two plots.

[TIME,Z] = ode45(@odefunc_double, [0,2*T], ic, options);
figure, plot(Z(:,1),Z(:,2)); hold on
scatter(mu_,0), scatter(-mu,0);
legend('show');
legend('Orbit', 'Moon', 'Earth')
axis([-1.5 1.5 -1.5 1.5]); axis equal, grid on;
title('y(x) (Double the initial velocity)');

Resultant Graph Plots:

y(x) 1.5 Orbit O Moon O Earth 0.5 -0.5 -1 21.5-1 0.5 0 0.5 1.5y(x) (Half the initial velocity) 2000 Orbit O Moon O Earth 0 -2000 4000 6000 -8000 -10000 -12000 14000 16000 -3 -2.5 -2 1.5 -y(x) (Double the initial velocity) 1.5 Orbit Moon O Earth 0.5 -0.5 -1 1.5-1 -0.5 0 0.5 1.5Note: Still if you have any doubts let me know in the comment box. Thank You. Good Luck>

Add a comment
Know the answer?
Add Answer to:
6. [20 points] The following nonlinear differential equations describe the motion of a body in orbit...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 4. Matlab Solvers: A Case Study in Mechanics Suppose we have two objects orbiting in space,...

    4. Matlab Solvers: A Case Study in Mechanics Suppose we have two objects orbiting in space, with masses 1 - and , rotating around each other. For example, think of the earth and the moon, where the moon moves around the earth at distance 1. (Of course, here both the masses and the distance are normalized.) A third object, which is relatively much smaller and does not affect the motion of the first two, is also orbiting in space. Think...

  • (3) (20 points) The (dimensionless) equations of motion for a frictionless double pendulum system...

    please use mathematica for code NOT MATLAB (3) (20 points) The (dimensionless) equations of motion for a frictionless double pendulum system as shown below (in the figure on the left) with mi m2 and L1 L are The solutions are graphed below (on the right) for the initial conditions θι (0) 2, θ1(0) 1.02(0) 0, and 02(0)-0 for oS t s 50. (a) Reformulate the IVP as a first order system.2 (b) Generate approximate solutions using any method (Euler, improved...

  • Need help solving these two second order differential equations, the picture below are the answers to...

    Need help solving these two second order differential equations, the picture below are the answers to them. I'm just stuck on how to work them out to get those solutions 3 Assignments 3.1 Analysis in the absence of air resistance Ignoring alr resistance, Newton's equations of motion for an object under the influence of gravity alone are quite straightforward. We're also ignoring the fact that the gravitational pull on an object above the earth depends upon its height above the...

  • The equations of motion for a particle of mass m and electrical charge q under the...

    The equations of motion for a particle of mass m and electrical charge q under the influence of a uniform magnetic field B perpendicular to the plane of motion are mx" = qBy' and my" = -qBx'. where x and y are the horizontal Cartesian position coordinates of the particle. Suppose that the particle initially satisfies the conditions Solve the initial value problem and sketch out the trajectory of the particle for t Greaterthanorequalto 0.

  • 2. For the simple pendulum shown in Figure 2, the nonlinear equations of motion are given by θ(t)...

    do (b) and (c) only. 2. For the simple pendulum shown in Figure 2, the nonlinear equations of motion are given by θ(t) + 믈 sin θ(t) + m 0(t)-0 Pivot point L, length Massless rod , mass Figure 2. A simple pendulum 3. Consider again the pendulum of Figure 2 of problem 2 when g = 9.8 m/s, 1 = 4.9m, k =0.3, and (a) Determine whether the system is stable by finding the characteristic equation obtained from setting...

  • Consider the following nonlinear differential equation, which models the unforced, undamped motio...

    Consider the following nonlinear differential equation, which models the unforced, undamped motion of a "soft" spring that does not obey Hooke's Law. (Here x denotes the position of a block attached to the spring, and the primes denote derivatives with respect to time t.) Note: x means x cubed notx a. Transform the second-order de. above into an equivalent system of first-order de.s. b. Use MATLAB's ode45 solver to generate a merical solution of this system aver the interval 0-t-6π...

  • Problem Set A Problem 6. (20%) A ordinary differential equation for a mass-damper-spring system is following....

    Problem Set A Problem 6. (20%) A ordinary differential equation for a mass-damper-spring system is following. The mass m 1, damping coetfic e initial position y(o) O, and the initial velocity i constant k 3 and force 10, all are in appropriate units. Th 1, spring zero, within the time range of O to 20 unit of time, use Matlab find the solution of function y(t)? Hint: you need to convert the 2nd order ODE into two 1st order ODEs....

  • modify this code is ready % Use ODE45 to solve Example 4.4.3, page 205, Palm 3rd...

    modify this code is ready % Use ODE45 to solve Example 4.4.3, page 205, Palm 3rd edition % Spring Mass Damper system with initial displacement function SolveODEs() clf %clear any existing plots % Time range Initial Conditions [t,y] = ode45( @deriv, [0,2], [1,0] ); % tvals yvals color and style plot( t, y(:,1), 'blue'); title('Spring Mass Damper with initial displacement'); xlabel('Time - s'); ylabel('Position - ft'); pause % hit enter to go to the next plot plot( t, y(:,2), 'blue--');...

  • Differential Equations with MATLAB/Plotting first order differential equations in Matlab/ Differential Equations MATLAB/IVP Matlab/IVP I'd really...

    Differential Equations with MATLAB/Plotting first order differential equations in Matlab/ Differential Equations MATLAB/IVP Matlab/IVP I'd really appreciate if I can get some help plotting these 3 first order differential equations as well as their comments. PLEASE! ANYTHING HELPS, I am very stuck :( EZplot and ODE 45 were mentioned in class and the instructions in class were not clear at all. Given the first order differential equation with initial condition. dy/dt = y t, y(0)=-1 Complete problems 1-3 in one...

  • PLEASE HELP SOLVE WITH MATLAB LANGUGE. Below are hints to the problem. THANKS A LOT!! 2...

    PLEASE HELP SOLVE WITH MATLAB LANGUGE. Below are hints to the problem. THANKS A LOT!! 2 Coriolis Force In a rotating frame-of-reference,the equations of motion of a particle, written in co- ordinates fixed to the frame, have additional terms due to the rotation of the frame itself Consider such a rotating frame, with its origin at the center of rotation.In these coor- dinates, the equations of motion for a point-mass subjected to forces F, and F S m, are F(0...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT