diff --git a/matlab/calcLumpedPort.m b/matlab/calcLumpedPort.m index 45f5af0..69dba69 100644 --- a/matlab/calcLumpedPort.m +++ b/matlab/calcLumpedPort.m @@ -17,6 +17,13 @@ function [port] = calcLumpedPort( port, SimDir, f, varargin) % 'SwitchDirection': 0/1, switch assumed direction of propagation % % output: +% % output signals/values in time domain (TD): +% port.ut.tot total voltage (time-domain) +% port.ut.time voltage time vector +% port.it.tot total current (time-domain) +% port.it.time current time vector +% +% % output signals/values in frequency domain (FD): % port.f the given frequency fector % port.uf.tot/inc/ref total, incoming and reflected voltage % port.if.tot/inc/ref total, incoming and reflected current @@ -73,6 +80,12 @@ I = ReadUI( port.I_filename, SimDir, f, UI_args{:} ); u_f = U.FD{1}.val; i_f = switch_dir*I.FD{1}.val; +port.ut.time = U.TD{1}.t; +port.ut.tot = U.TD{1}.val; + +port.it.time = I.TD{1}.t; +port.it.tot = switch_dir*I.TD{1}.val; + port.Zin = u_f./i_f; port.f = f; diff --git a/matlab/calcPort.m b/matlab/calcPort.m index 97db26e..a365944 100644 --- a/matlab/calcPort.m +++ b/matlab/calcPort.m @@ -21,6 +21,13 @@ function [port] = calcPort( port, SimDir, f, varargin) % 'SwitchDirection': 0/1, switch assumed direction of propagation % % output: +% % output signals/values in time domain (TD): +% port.ut.tot total voltage (time-domain) +% port.ut.time voltage time vector +% port.it.tot total current (time-domain) +% port.it.time current time vector +% +% % output signals/values in frequency domain (FD): % port.f the given frequency fector % port.uf.tot/inc/ref total, incoming and reflected voltage % port.if.tot/inc/ref total, incoming and reflected current diff --git a/matlab/calcTLPort.m b/matlab/calcTLPort.m index be51a14..cf99c7e 100644 --- a/matlab/calcTLPort.m +++ b/matlab/calcTLPort.m @@ -22,6 +22,13 @@ function [port] = calcTLPort( port, SimDir, f, varargin) % 'SwitchDirection': 0/1, switch assumed direction of propagation % % output: +% % output signals/values in time domain (TD): +% port.ut.tot total voltage (time-domain) +% port.ut.time voltage time vector +% port.it.tot total current (time-domain) +% port.it.time current time vector +% +% % output signals/values in frequency domain (FD): % port.f the given frequency fector % port.uf.tot/inc/ref total, incoming and reflected voltage % port.if.tot/inc/ref total, incoming and reflected current @@ -96,6 +103,13 @@ end % read time domain data (multiples files) I = ReadUI( port.I_filename, SimDir, f, UI_args{:} ); +% time domain signals +port.ut.time = U.TD{2}.t; +port.ut.tot = U.TD{2}.val; + +port.it.time = I.TD{1}.t; +port.it.tot = switch_dir*(I.TD{1}.val + I.TD{2}.val) / 2; % interpolate to same position as v + % store the original frequency domain waveforms u_f = U.FD{2}.val; i_f = switch_dir*(I.FD{1}.val + I.FD{2}.val) / 2; % shift to same position as v diff --git a/matlab/calcWGPort.m b/matlab/calcWGPort.m index a0610de..ba845af 100644 --- a/matlab/calcWGPort.m +++ b/matlab/calcWGPort.m @@ -24,6 +24,13 @@ function [port] = calcWGPort( port, SimDir, f, varargin) % 'SwitchDirection': 0/1, switch assumed direction of propagation % % output: +% % output signals/values in time domain (TD): +% port.ut.tot total voltage (time-domain) +% port.ut.time voltage time vector +% port.it.tot total current (time-domain) +% port.it.time current time vector +% +% % output signals/values in frequency domain (FD): % port.f the given frequency fector % port.uf.tot/inc/ref total, incoming and reflected voltage % port.if.tot/inc/ref total, incoming and reflected current @@ -84,6 +91,14 @@ I = ReadUI( port.I_filename, SimDir, f, UI_args{:} ); u_f = U.FD{1}.val; i_f = I.FD{1}.val * switch_dir; +% time domain signal +port.ut.time = U.TD{1}.t; +port.ut.tot = U.TD{1}.val; + +port.it.time = I.TD{1}.t; +port.it.tot = switch_dir*I.TD{1}.val; + + physical_constants k = 2*pi*f/C0*ref_index; fc = C0*port.kc/2/pi/ref_index;