0% found this document useful (0 votes)
8 views

Pycode

Uploaded by

hplaptop175k
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Pycode

Uploaded by

hplaptop175k
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

------Q7 Part 1-----

import numpy as np
import matplotlib.pyplot as plt

x=np.linspace(-10,10,1000)
x = x[(x != -3) & (x != 1/2)]

y=(x**2+1)/(2*x**2+5*x-3)

plt.ylim(-5,5)
plt.axhline(y=0.5, color='black', linestyle='--')
plt.axvline(x=0.5, color='black', linestyle='--')
plt.axvline(x=-3, color='black', linestyle='--')

x1=0
y1=0
plt.scatter(x1,y1,color='black')
plt.title("Q 7 Part 1")
plt.xlabel("x-axis")
plt.ylabel("(x**2+1)/(2*x**2+5*x-3)")
plt.plot(x,y)
plt.grid(True)
plt.show()

------Q7 Part 2-----


import numpy as np
import matplotlib.pyplot as plt

x=np.linspace(-10,10,1000)
x = x[(x != 1) & (x != -2)]

y=(2*x**2+x-1)/(x**2+x-2)

plt.ylim(-5,5)
plt.axhline(y=2, color='black', linestyle='--')
plt.axvline(x=1, color='black', linestyle='--')
plt.axvline(x=-2, color='black', linestyle='--')

x1=0
y1=0
plt.scatter(x1,y1,color='black')
plt.title("Q 7 Part 2")
plt.xlabel("x-axis")
plt.ylabel("(2*x**2+x-1)/(x**2+x-2)")
plt.plot(x,y)
plt.grid(True)
plt.show()
------Q7 Part 3-----

import numpy as np
import matplotlib.pyplot as plt

x=np.linspace(-10,10,1000)
y2=x+1

x!=1
y=(x**2-4)/(x-1)

plt.ylim(-5,5)
plt.axvline(x=1, color='black', linestyle='--')

x1=0
y1=0
plt.scatter(x1,y1,color='black')
plt.title("Q 7 Part 3")
plt.xlabel("x-axis")
plt.ylabel("(x**2-4)/(x-1)")
plt.plot(x,y)
plt.plot(x,y2,color='black')
plt.grid(True)
plt.show()

You might also like