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 Seco9_ODEs to work through this prohiem. Polydropic spheres are the simplest representation of atars. Do not woiry about the underlying physics, here wo just want to solve the following fwo 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 racius 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 aere if/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 atated 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 inlormative and professionally looking as possible. Inside of the plot hindow 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 radius 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=1 to P0=100. For each value of P0 in the array repeat the calculation above and find the conresponding values of R,andM.. You thus should have 1000 values of R,and and M. Plot M as a function of R in another plot window. Using the "worked example: exoplanets" in Section 08. nake a power-law fit to the Ms. 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

Recommended Textbook for

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

Students also viewed these Databases questions

Question

What are the purposes of promotion ?

Answered: 1 week ago