Binary stars are two stars orbiting a common center of mass. The apparent brightness of a binary star, measured as magnitude varies. It can be calculated through a complex mathematical model but we can approximate the brightness of a binary star as a cyclic function of time. For example, for the red giant star Mira and its companion, we use the approximation as follows: At time t = 0 days, its magnitude is 2.5, and it stays at this level until t = 0.9 days. Its magnitude is then determined by the formula 7(t – 0.9)] 3.255 – In 1.352 + cos- 0.7 until t = 2.3 days, its magnitude is then 2.5 until t = 4.4 days, and it is then determined by the formula 7(t – 4.4)] 3.598 – In 1.998 + cos- 0.4 until t = 5.2. It then remains at 2.5 until t = 6.4 days, after which the cycle repeats with a period of 6.4 days. Write a PYTHON program to read in the value of time /in days and print the magnitude of the red giant star Mira A and its companion at that time. See run samples when input data is valid (figure 1). Your program prints out an error message when the time value is negative (figure 2). In (28]: runfile('/Users/hamzazidoum/Documents/2101/2101_F2021/PA2/ PA2_Hz. py', wdir='/Users/hamzazidoum/Documents/2101/2101_F2021/PA2' ) PROGRAM TO COMPUTE THE BRIGHTNESS OF TWIN STARS Enter time in days: 11 Magnitue of binary star at time 11.e days is 2.906 Bye!... In [29]: | Figure 1: Sample Input/Output when input data is valid

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Python, Please use Spyder 

Problem Definition
Binary stars are two stars orbiting a common center of mass. The apparent brightness of a binary
star, measured as magnitude varies. It can be calculated through a complex mathematical model but
we can approximate the brightness of a binary star as a cyclic function of time. For example, for the
red giant star Mira and its companion, we use the approximation as follows:
At time t = 0 days, its magnitude is 2.5, and it stays at this level until t = 0.9 days. Its magnitude is
then determined by the formula
T(t – 0.9)]
0.7
3.255 – In 1.352 + cos·
until t = 2.3 days, its magnitude is then 2.5 until t = 4.4 days, and it is then determined by the
formula
T(t – 4.4)]
3.598 – In 1.998 + cos-
0.4
until t = 5.2. It then remains at 2.5 until t = 6.4 days, after which the cycle repeats with a period of
6.4 days.
Write a PY'THON program to read in the value of time tin days and print the magnitude of the red
giant star Mira A and its companion at that time. See run samples when input data is valid (figure 1).
Your program prints out an error message when the time value is negative (figure 2).
In (28): runfile('/Users/hamzazidoum/Documents/2101/2101_F2®21/PA2/
PA2_Hz. py', wdir='/Users/hamzazidoum/Documents/2101/2101_F2021/PA2' )
PROGRAM TO COMPUTE THE BRIGHTNESS OF TWIN STARS
Enter time in days: 11
Magnitue of binary star at time 11.e days is 2.906
Bye!...
In [29]: |
Figure 1: Sample Input/Output when input data is valid
Transcribed Image Text:Problem Definition Binary stars are two stars orbiting a common center of mass. The apparent brightness of a binary star, measured as magnitude varies. It can be calculated through a complex mathematical model but we can approximate the brightness of a binary star as a cyclic function of time. For example, for the red giant star Mira and its companion, we use the approximation as follows: At time t = 0 days, its magnitude is 2.5, and it stays at this level until t = 0.9 days. Its magnitude is then determined by the formula T(t – 0.9)] 0.7 3.255 – In 1.352 + cos· until t = 2.3 days, its magnitude is then 2.5 until t = 4.4 days, and it is then determined by the formula T(t – 4.4)] 3.598 – In 1.998 + cos- 0.4 until t = 5.2. It then remains at 2.5 until t = 6.4 days, after which the cycle repeats with a period of 6.4 days. Write a PY'THON program to read in the value of time tin days and print the magnitude of the red giant star Mira A and its companion at that time. See run samples when input data is valid (figure 1). Your program prints out an error message when the time value is negative (figure 2). In (28): runfile('/Users/hamzazidoum/Documents/2101/2101_F2®21/PA2/ PA2_Hz. py', wdir='/Users/hamzazidoum/Documents/2101/2101_F2021/PA2' ) PROGRAM TO COMPUTE THE BRIGHTNESS OF TWIN STARS Enter time in days: 11 Magnitue of binary star at time 11.e days is 2.906 Bye!... In [29]: | Figure 1: Sample Input/Output when input data is valid
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY