Advertisement
jrcamey

Untitled

Sep 17th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Wed Sep 17 11:46:21 2014
  4.  
  5. @author: Jose R
  6. """
  7.  
  8. from sympy import *
  9. from sympy.abc import x,y,r,h
  10. from sympy.plotting import plot ## Necesitamos para graficar
  11. import math
  12. ##Cubo
  13. fo1 = (2*(x**2))+4*x*y
  14. res1 = 237/(x**2)
  15. fo1 = fo1.subs(y,res1)
  16. cubo = diff(fo1, x, 1)
  17. ecc1 = Eq(cubo, 0)
  18. pcc1 = solve(ecc1, x)
  19. alturacubo = fo1.subs(x,pcc1[0])
  20.  
  21. ##Cilindro
  22. fo2 = 2*math.pi*r*h + 4*math.pi*(r**2)
  23. res2 = 237/(2*math.pi*(r**2))
  24. fo2 = fo2.subs(h, res2)
  25. cilindro = diff (fo2, r, 1)
  26. ecc2 = Eq(cilindro, 0)
  27. pcc2 = solve(ecc2, r)
  28. alturacilindro = fo2.subs(r, pcc2[0])
  29.  
  30. ##Esfera
  31. fo3 = (4/3)*math.pi*(r**3) - 237
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement