fork download
  1. # your code goes here
  2.  
  3. import numpy as np
  4. import matplotlib.pyplot as plt
  5.  
  6. def I(x):
  7. return (-0.01 * x * x)/2 + 50 * x
  8.  
  9. def K(x):
  10. return (0.03 * x * x)/2 + 31 * x + 3000
  11.  
  12. Kx = []
  13. Ky = []
  14. Ix = []
  15. Iy = []
  16.  
  17. for x in np.arange(0, 850, 0.1):
  18. Ix.append(x)
  19. Kx.append(x)
  20. Iy.append(I(x))
  21. Ky.append(K(x))
  22.  
  23.  
  24. plt.plot(Kx, Ky)
  25. plt.plot(Ix, Iy)
  26. plt.show()
  27.  
Success #stdin #stdout #stderr 0.83s 70660KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused

(prog:10660): Gdk-CRITICAL **: 18:14:27.033: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(prog:10660): Gdk-CRITICAL **: 18:14:27.034: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed