Telegraphengleichung

166 days ago by L3on

R = SR.symbol("R", domain='positive') G = SR.symbol("G", domain='positive') L = SR.symbol("L", domain='positive') C = SR.symbol("C", domain='positive') omega = SR.symbol("omega", domain='positive') C = 100e-12 L = 775e-9 U0 = 1 G=0 R=100e-3 y1 = ((R + 1j*omega*L)*(G + 1j*omega*C))**0.5 y2 = 1j*acos(1-omega**2/2*L*C) y3 = (1j*acos(1+(R+1j*omega*L)*(G+1j*omega*C)/2)).radical_simplify() vph1 = omega/y1.imag() vph2 = omega/y2.imag() vph3 = omega/y3.imag() vgr1 = vph1.diff(omega,1) vgr2 = vph2.diff(omega,1) vgr3 = vph3.diff(omega,1) U1(x,t) = U0*e**(1j*omega*t-y1*x) U2(x,t) = U0*e**(1j*omega*t-y2*x) 
       
o = open('output.txt','w') o.write("f;w;a;b;vph;wg1;wg2\n") wg1 = R/L wg2 = 1/(R*C)**0.5 for i in range(1, 10): for d in range(2,20): f = 10**i *d w = 10**i *d *2 * 3.14 if w < 1e12: _vph = vph3(w) _vgr = 0 _a = y3(w).real() _b = y3(w).imag() o.write((str(f) + ";" + str(w) + ";" + str(_a) + ";" + str(_b) + ";" + str(_vph) +"\n")) w = wg2 f = w /(2*3.13) _vph = vph3(w) _a = y3(w).real() _b = y3(w).imag() o.write((str(f) + ";" + str(w) + ";" + str(_a) + ";" + str(_b) + ";" + str(_vph) +"\n")) o.close() 
       
__main__:1: DeprecationWarning: Substitution using function-call syntax
and unnamed arguments is deprecated and will be removed from a future
release of Sage; you can use named arguments instead, like EXPR(x=...,
y=...)
__main__:1: DeprecationWarning: Substitution using function-call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...)
p = plot(vph3,(1,1e9)) p = plot(y3.real(),(1,1e8)) 
       
Traceback (click to the left of this block for traceback)
...
NameError: name 'vph3' is not defined
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_2.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cCA9ICBwbG90KHZwaDMsKDEsMWU5KSkKcCA9IHBsb3QoeTMucmVhbCgpLCgxLDFlOCkp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmp4Q5YzW/___code___.py", line 3, in <module>
    p =  plot(vph3,(_sage_const_1 ,_sage_const_1e9 ))
NameError: name 'vph3' is not defined
p.show()