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
  plotting inside the loop is not working jenya56 4 97 Apr-10-2019, 08:11 PM
Last Post: perfringo
  System of 3 non-linear equations in 3 unknowns (how-to-solve?) samsonite 2 103 Mar-23-2019, 10:14 AM
Last Post: samsonite
  Plotting help! Time is of the essence lordhyperfluxed 6 152 Mar-22-2019, 12:50 PM
Last Post: scidam
  basic plotting question Devilish 0 216 Dec-27-2018, 10:35 PM
Last Post: Devilish
  Plotting datas Krszt 2 267 Oct-31-2018, 03:29 PM
Last Post: Davis4109
  problem in plotting intraday results using matplotlib mr_byte31 0 427 Aug-20-2018, 11:32 AM
Last Post: mr_byte31
  Graph Plotting Help Talch 1 323 Aug-16-2018, 10:29 PM
Last Post: Larz60+
  Vpython Delay in plotting points SohaibAJ 0 253 Jul-30-2018, 08:44 PM
Last Post: SohaibAJ
  Plotting distribution of a variable on the map with a shape file fyec 0 401 Jun-22-2018, 09:43 PM
Last Post: fyec
  plotting 2 different set of data in a single plot with shared axes. upasana 4 619 Mar-21-2018, 01:43 PM
Last Post: upasana

Forum Jump:


Users browsing this thread: 1 Guest(s)