Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plotting of equations
#1
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?
Quote
#2
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)
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  basic plotting question Devilish 0 150 Dec-27-2018, 10:35 PM
Last Post: Devilish
  Plotting datas Krszt 2 209 Oct-31-2018, 03:29 PM
Last Post: Davis4109
  problem in plotting intraday results using matplotlib mr_byte31 0 316 Aug-20-2018, 11:32 AM
Last Post: mr_byte31
  Graph Plotting Help Talch 1 267 Aug-16-2018, 10:29 PM
Last Post: Larz60+
  Vpython Delay in plotting points SohaibAJ 0 203 Jul-30-2018, 08:44 PM
Last Post: SohaibAJ
  Plotting distribution of a variable on the map with a shape file fyec 0 337 Jun-22-2018, 09:43 PM
Last Post: fyec
  plotting 2 different set of data in a single plot with shared axes. upasana 4 537 Mar-21-2018, 01:43 PM
Last Post: upasana
  Beginner: System of Equations Mahdi1994 2 536 Mar-19-2018, 12:37 AM
Last Post: Tiskolin
  plotting trend Firstname_Lastname 1 605 Sep-09-2017, 09:32 PM
Last Post: jogl
  These simple equations comes up as an error M3RCY 4 1,039 Jul-11-2017, 06:24 PM
Last Post: nilamo

Forum Jump:


Users browsing this thread: 1 Guest(s)