= #JxnPortable\docs\gallery\SliderAnimation3a_RLC_circuit.jxn

#ifndef owner
owner = @java.awt.Frame( "Reihenschwingkreis  | Series RLC Circuit" )
#endif
#JXN:include/SliderInclude.jxn
!
frel1 = slider.add( "f / f0", 0.75, 0.01, 100. )
Z1 = 1 + j ( frel1 - 1 / frel1 )
Y1 = 1 / Z1
!
frel2 = 10^(0.2x)
Z2 = 1 + j ( frel2 - 1 / frel2 )
Y2 = 1 / Z2
!
#ifdef LIN
pf1 = plot( log10 frel2, abs Y2, phi Y2 / PI )
pf1.add( @JxnSymbolPainter( 1, log10 frel1, abs Y1, 5 ) )
pf1.add( @JxnSymbolPainter( 1, log10 frel1, phi Y1 / PI, 5 ).setColor(B) )
pf1.setXYLabels( "log10( f / f0 )", "|Y|,  \u966(Y) / \u960" ).setPlotFrameTitle( "Series RLC circuit: Y(f)" )
#else if $this.isDefined "LOGXY"
pf1 = plot( frel2, 1 + log10 abs Y2, 3 ).add( frel2, phi Y2 / PI, B )
pf1.add( @JxnSymbolPainter( 1, frel1, 1 + log10 abs Y1, 5 ) )
pf1.add( @JxnSymbolPainter( 1, frel1, phi Y1 / PI, 5 ).setColor(B) )
pf1.setXYLabels( "f / f0", "" ).setPlotFrameTitle( "Series RLC circuit: Y(f)" )
pf1.setHeadline( "1 + log10 |Y|,  \u966(Y) / \u960                                                                           " )
#else
pf1 = plot( frel2, abs Y2, 3 ).add( frel2, phi Y2 / PI, B )
pf1.add( @JxnSymbolPainter( 1, frel1, abs Y1, 5 ) )
pf1.add( @JxnSymbolPainter( 1, frel1, phi Y1 / PI, 5 ).setColor(B) )
pf1.setXYLabels( "f / f0", "|Y|,  \u966(Y) / \u960" ).setPlotFrameTitle( "Series RLC circuit: Y(f)" )
#endif
!
! alternative for pf2:
! pf3 = plot( Y1, "Y", B ).add( curve( real Y2, imag Y2, R ) )
pf2 = plot( real Y2, imag Y2, 1. ).add( phasor( Y1, "Y", G ) ).add( angle( 0.7 + 0 j, Y1, 0.5, "\#966;", B ) )
pf2.setXYLabels( "re(Y)", "im(Y)" ).setPlotFrameTitle( "Series RLC circuit: Y(f)" )
!
#ifdef owner
owner.setFont( @java.awt.Font( "Dialog", 0, 18 ) )
#endif
#JXN:include/Grid2Include.jxn
#JXN:include/FrameInclude.jxn