import matplotlib.pyplot as plt vtn = 0.7 vtp = -0.7 vdd = 5 Bn = Bp = 380 vout = [None]*26 vin = [0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0,2.2,2.4,2.6,2.8,3.0,3.2,3.4,3.6,3.8,4.0,4.2,4.4,4.6,4.8,5.0] for i in range(0,26): if 0<=vin[i]<=vtn : vout[i] = vdd elif vtn <= vin[i] <= vdd / 2: vout[i] = (vin[i] - vtp) + ((vin[i] - vtp) ** 2 - 2 * (vin[i] - vdd / 2 - vtp) * vdd - Bn/Bp * (vin[i] - vtn) ** 2) ** 0.5 elif vin[i] == vdd / 2: vout[i] = vin[i] elif vdd / 2 < vin[i] <= vdd + vtp: vout[i] = (vin[i] - vtn) - ((vin[i] - vtn)** 2 - Bn/Bp * (vin[i] - vdd - vtp)** 2)** 0.5 elif vin[i] > vdd + vtp: vout[i] = 0 plt.plot(vin, vout, marker="o") plt.xlabel("Vin") plt.ylabel("Vout") plt.show()     this code in python and out this picture  each if statement represent different region I want colored each region in different color please

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

import matplotlib.pyplot as plt

vtn = 0.7
vtp = -0.7
vdd = 5
Bn = Bp = 380
vout = [None]*26
vin = [0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0,2.2,2.4,2.6,2.8,3.0,3.2,3.4,3.6,3.8,4.0,4.2,4.4,4.6,4.8,5.0]



for i in range(0,26):

if 0<=vin[i]<=vtn :
vout[i] = vdd


elif vtn <= vin[i] <= vdd / 2:
vout[i] = (vin[i] - vtp) + ((vin[i] - vtp) ** 2 - 2 * (vin[i] - vdd / 2 - vtp) * vdd - Bn/Bp * (vin[i] - vtn) ** 2) ** 0.5


elif vin[i] == vdd / 2:
vout[i] = vin[i]


elif vdd / 2 < vin[i] <= vdd + vtp:
vout[i] = (vin[i] - vtn) - ((vin[i] - vtn)** 2 - Bn/Bp * (vin[i] - vdd - vtp)** 2)** 0.5


elif vin[i] > vdd + vtp:
vout[i] = 0



plt.plot(vin, vout, marker="o")
plt.xlabel("Vin")
plt.ylabel("Vout")
plt.show()

 

 

this code in python and out this picture 

each if statement represent different region I want colored each region in different color please

Vout
5
4
2
1
0
0
N
Vin
m
4
5
Transcribed Image Text:Vout 5 4 2 1 0 0 N Vin m 4 5
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

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

What is 

S variable 

Solution
Bartleby Expert
SEE SOLUTION
Follow-up Question

This just colored the point 

I want coloring the line also please

Solution
Bartleby Expert
SEE SOLUTION
Follow-up Question

How can I change this color to another color ?

Solution
Bartleby Expert
SEE SOLUTION
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