Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Fasit:
- import numpy as np
- import matplotlib.pyplot as plt
- #Funksjon som gir hvor mange prosent som er igjen av stoffet etter t tid.
- def p(t,h):
- return 2*0.5**(t/h)
- #Be om verdier for t og h.
- t = np.linspace(0, float(input("Hvor lang tid skal gĂĽ? ")), 1000)
- h = float(input("Hva er halveringstida? "))
- #Lage graf.
- fig = plt.figure()
- ax1 = fig.add_subplot(111)
- ax1.grid(True)
- x = t
- y = p(t,h)
- ax1.plot(x,y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement