Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- """
- Created on Tue Jun 12 11:55:12 2018
- @author: janer
- """
- import numpy as np
- import matplotlib.pyplot as plt
- from scipy import interpolate as itp
- data = np.loadtxt('Werte200.txt')
- f = data[:,0]
- U0 = data[:,1]
- Uc = data[:,2]
- Ul = data[:,3]
- Ua = data[:,4]
- Ukr = data[:,5]
- I = (Ua/200)*1000
- f_new = np.linspace(f.min(),f.max(), 10000)
- tckUc = itp.splrep(f, Uc, s=0)
- tckUl = itp.splrep(f, Ul, s=0)
- tckUa = itp.splrep(f, Ua, s=0)
- tckUkr = itp.splrep(f, Ukr, s=0)
- tckI = itp.splrep(f, I, s=0)
- Uc_new = itp.splev(f_new, tckUc, der=0)
- Ul_new = itp.splev(f_new, tckUl, der=0)
- Ua_new = itp.splev(f_new, tckUa, der=0)
- I_new = itp.splev(f_new, tckI, der=0)
- Ukr_new = itp.splev(f_new, tckUkr, der=0)
- plt.plot([488.678,488.678], [0.936,0], color ='red', linewidth=1.5, linestyle="--")
- plt.text(488,0,'f0',size = 15, color = 'red')
- plt.plot([419.063,419], [0.6874,0], color ='red', linewidth=1.5, linestyle="--")
- plt.text(419,0,'f1',size = 15, color = 'red')
- plt.plot([572.346,572.346], [0.6856,0], color ='red', linewidth=1.5, linestyle="--")
- plt.text(572,0,'f2',size = 15, color = 'red')
- plt.plot(f, Uc, 'b.')
- plt.plot(f_new, Uc_new, 'b-', label = 'Uc')
- plt.plot(f, Ul, 'g.')
- plt.plot(f_new, Ul_new, 'g-', label = 'Ul')
- plt.plot(f, Ua, 'y.')
- plt.plot(f_new, Ua_new, 'y-', label = 'Ua')
- plt.plot(f, Ukr, 'k.')
- plt.plot(f_new, Ukr_new, 'k-', label = 'Ukr')
- plt.plot(f, I, 'r.')
- plt.plot(f_new, I_new, 'r-', label = 'I')
- plt.xlabel('f / Hz')
- plt.ylabel('U / V')
- plt.title('Spannungskennlinien für Ra = 200 Ω')
- plt.legend(loc = 'upper right')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement