Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 3 - Group B. Use Odeint package to solve the following set of equations [20 points] In Section 9 of the course we learned

image text in transcribed
Problem 3 - Group B. Use Odeint package to solve the following set of equations [20 points] In Section 9 of the course we learned how to integrate Ordinary Differential Equations. Use the examples given in Sec09_ODEs to work through this problem Polytropic spheres are the simplest representation of stars. Do not worry about the underlying physics, here we just want to solve the following two coupled equations: drdP=c2+r2M.drdM=4r2. as long as P>0. Here r is radius from the centre of the sphere, P is the gas pressure at that radius, and M is the mass of the gas inside radius r. The quantites c=0.0001,K=1 and =5/3 are constants. The variable is gas density, and is given by =(KF)1/ for positive values of P, and is zero it where P drops to zero or becomes negative. The equations are subject to the boundary conditions in the centre of the sphere, M(r=0)=0 and P(r=0)=P0, where P0 is a constant. - Solve these equations on a linear grid of 1000 points from r=0 to r=2 for P0=1 using the Odeint package. ( Note : As stated above, where P becomes negative, simply set P=0,=0, this is vacuum outside of our star). Plot functions P(r) and M(r) on the same plot making it as informative and protessionally looking as possible. Inside of the plot Lindow print the value of the radius r where P first becomes negative, and the corresponding value of M. These values of r and M are the fadius and the mass of the star, R, and M, respectively. [10] - Now we explore how the results vary when parameter P0 varies. Create an array of 100P0 values covering the range from P0=I to P0=100. For each value of P0 in the array repeat the calculation above and find the corresponding values of R, and M. You thus should have 1000 values of R, and M.. Plot M, as a function of R, in another plot window. Using the "worked example, exoplanets" in Section 08, make a power-law fit to the M, vs R, relationship, and display it on the same plot. [10] Nint: making some plots logarithmic may be a good idea

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1. Which is the most abundant gas presented in the atmosphere?

Answered: 1 week ago

Question

Explain basic guidelines for effective multicultural communication.

Answered: 1 week ago

Question

Identify communication barriers and describe ways to remove them.

Answered: 1 week ago

Question

Explain the communication process.

Answered: 1 week ago