! #JxnPortable\docs\gallery\LeitungsWelleComplex~KOPIE.jxn

#ifndef owner
owner = @java.awt.Frame( "LeitungsWelle | Line Wave" )
#endif
#JXN:include/SliderInclude
!
! LeitungsWelle - eingeschwungener Zustand
!
rB = slider.add( "rB", 0.5, 0., 0.1 )
#ifndef owner
lB = slider.add( "lB", 1., 0., 2. )
gB = slider.add( "gB", 0.01, 0., 0.1 )
cB = slider.add( "cB", 1., 0., 2. )
#else
lB = 1.
gB = 0.01
cB = 1.
#endif
laenge = slider.add( "laenge", 2.5, 0., 10. )

#ifndef owner
f = slider.add( "f", 1., 0., 5. )
#else
f = 1.
#endif
UE = slider.add( "UE", 1., 0., 2. )
absIE = slider.add( "IE", 0., 0., 2. )
phiL = slider.add( "phiL", 0., -180., 180. )

! #JXN:include/P3dInclude
p3d_dz = 100.
p3d_alpha = slider.add( "alpha", 19.5,  -90.,  90. )
p3d_phi   = slider.add( "phi",  -20.7, -180., 180. )
p3d = @KmgPerspectiveProjection( p3d_phi, p3d_alpha, p3d_dz )

x = t
z = laenge * ( 1 - x )
t = slider.add( "t", 0., 0., 20. )

omega = 2 PI f
Z0    = sqrt( ( rB + j omega lB ) / ( gB + j omega cB ) )
gamma = sqrt( ( rB + j omega lB ) * ( gB + j omega cB ) )

gz = gamma z
IE = @JxnComplexAlgebra( absIE, -phiL, true )

Uz =   UE        cosh gz + IE Z0 sinh gz
Iz = ( UE / Z0 ) sinh gz + IE    cosh gz

Uzt = Uz exp j omega t
Izt = Iz exp j omega t

pf1 = plot( x, 0.5 real Izt, real Uzt, abs Uz ).add( curve( x, -0.5 abs Iz, G ) )
!              0.5 hier nur fuer Ausgabeskalierung
nz = length z - 1
ia = 5 { 0 : nz / 5 }
pf2 = plot( p3d, 1. )
pf2.add( @JxnVectorAlgebra( 0., 0.5 laenge ( 2 ia / nz - 1 ), 0. ), @JxnVectorAlgebra( 0.5 real Izt[ia], 0., 0.5 imag Izt[ia] ), R )
pf2.add( @JxnVectorAlgebra( 0., 0.5 laenge ( 2 ia / nz - 1 ), 0. ), @JxnVectorAlgebra(     real Uzt[ia], 0.,     imag Uzt[ia] ), B )
! pf2.setAuto( false )
!
#JXN:include/Grid2Include
#JXN:include/FrameInclude