Bottom Page

• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 Plotting of equations mudezda1 Unladen Swallow Posts: 3 Threads: 2 Joined: Feb 2019 Reputation: 0 Likes received: 0 #1 Feb-11-2019, 03:52 PM import numpy as np import matplotlib.pyplot as plt l= 1.5 m= 2.5 g= 9.81 d= 2.7 k= 9.08 angles = np.arange(360) / 180 * np.pi x = ((m * g)/(k * d)) * np.tan(angles) y = 1 - ((2 * l) / d) * np.sin(angles) plt.plot(x,y) plt.show() Im trying to plot these two equations but they wont come up, although if i plot eqution y by itself it does come up. My aim is to plot these two equations and note down where they meet. How could i do that? scidam Posts: 614 Threads: 1 Joined: Mar 2018 Reputation: 81 Likes received: 95 #2 Feb-13-2019, 07:26 AM This is likely because tan(90 deg) is infinity. You need to exclude pi/2 (90 deg) and 3pi/2 (270 deg) from angles array. It could be done by using arange with different step, e.g. arange(0, 360, 0.3) « Next Oldest | Next Newest »

Top Page

Forum Jump:

Users browsing this thread: 1 Guest(s)