Create a program which will plot the “uneclipsed” area of the star as a function of time - just like our analytical solution for the square star/planet - starting at the time between when the planet first starts to overlap the star to when the whole planet has passed in front of the star. You will need variables for the velocity of the planet, the side lengths of the star and planet. For the velocity of the planet use an arbitrary number such as 0.001 (in Jupiters/second). For now, don’t worry about a realistic velocity of the planet. You will need arrays for the area and the time that has passed. Hint: the time array can be initialized with a list of times like earlier in this handout and the area array can be empty. You will need to loop over time, and use logic statements to determine what expression from the analytical solution you will need to use for the “uneclipsed” area. Hint: you can then add the area at each time to the area array with area.append(uneclipsedArea) Finally, you will need to plot the data you just generated! If the brightness is proportional to the area, what would you use to plot the transit lightcurve shape from previous lessons?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Create a program which will plot the “uneclipsed” area of the star as a function of time - just like our analytical solution for the square star/planet - starting at the time between when the planet first starts to overlap the star to when the whole planet has passed in front of the star.

You will need variables for the velocity of the planet, the side lengths of the star and planet. For the velocity of the planet use an arbitrary number such as 0.001 (in Jupiters/second). For now, don’t worry about a realistic velocity of the planet.

You will need arrays for the area and the time that has passed. Hint: the time array can be initialized with a list of times like earlier in this handout and the area array can be empty.

You will need to loop over time, and use logic statements to determine what expression from the analytical solution you will need to use for the “uneclipsed” area. Hint: you can then add the area at each time to the area array with area.append(uneclipsedArea)

Finally, you will need to plot the data you just generated! If the brightness is proportional to the area, what would you use to plot the transit lightcurve shape from previous lessons?

 

Expert Solution
Step 1

Here's an example Python program that plots the "uneclipsed" area of a square planet passing in front of a square star as a function of time. The program assumes that the planet is moving at a constant velocity of 0.001 Jupiters/second and that the side lengths of the star and planet are 2 and 1, respectively (in arbitrary units).

 

import numpy as np
import matplotlib.pyplot as plt

# Define constants
v_planet = 0.001  # Jupiters/second
a_star = 2.0  # units
a_planet = 1.0  # units

# Initialize time array
t = np.linspace(0, 20, 1000)  # seconds

# Initialize area array
area = []

# Loop over time and calculate uneclipsed area
for time in t:
    x_planet = v_planet * time  # position of planet's leading edge
    x_overlap = x_planet - a_planet  # position of overlap
    if x_overlap < -a_star:
        # planet hasn't reached star yet
        uneclipsed_area = a_planet**2
    elif x_overlap < a_star:
        # planet partially overlaps star
        uneclipsed_area = a_planet**2 - (a_star + x_overlap)**2
    else:
        # planet has passed star
        uneclipsed_area = a_planet**2 - 4*a_star**2
    area.append(uneclipsed_area)

# Plot uneclipsed area as a function of time
plt.plot(t, area)
plt.xlabel('Time (seconds)')
plt.ylabel('Uneclipsed area')
plt.show()

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

for the transit lightcurve I get an error message:

 

 

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education