ports: calculate/export time domain voltages and currents
Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>pull/12/head
parent
3fc2a41af9
commit
32a907a26e
|
@ -17,6 +17,13 @@ function [port] = calcLumpedPort( port, SimDir, f, varargin)
|
||||||
% 'SwitchDirection': 0/1, switch assumed direction of propagation
|
% 'SwitchDirection': 0/1, switch assumed direction of propagation
|
||||||
%
|
%
|
||||||
% output:
|
% 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.f the given frequency fector
|
||||||
% port.uf.tot/inc/ref total, incoming and reflected voltage
|
% port.uf.tot/inc/ref total, incoming and reflected voltage
|
||||||
% port.if.tot/inc/ref total, incoming and reflected current
|
% 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;
|
u_f = U.FD{1}.val;
|
||||||
i_f = switch_dir*I.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.Zin = u_f./i_f;
|
||||||
|
|
||||||
port.f = f;
|
port.f = f;
|
||||||
|
|
|
@ -21,6 +21,13 @@ function [port] = calcPort( port, SimDir, f, varargin)
|
||||||
% 'SwitchDirection': 0/1, switch assumed direction of propagation
|
% 'SwitchDirection': 0/1, switch assumed direction of propagation
|
||||||
%
|
%
|
||||||
% output:
|
% 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.f the given frequency fector
|
||||||
% port.uf.tot/inc/ref total, incoming and reflected voltage
|
% port.uf.tot/inc/ref total, incoming and reflected voltage
|
||||||
% port.if.tot/inc/ref total, incoming and reflected current
|
% port.if.tot/inc/ref total, incoming and reflected current
|
||||||
|
|
|
@ -22,6 +22,13 @@ function [port] = calcTLPort( port, SimDir, f, varargin)
|
||||||
% 'SwitchDirection': 0/1, switch assumed direction of propagation
|
% 'SwitchDirection': 0/1, switch assumed direction of propagation
|
||||||
%
|
%
|
||||||
% output:
|
% 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.f the given frequency fector
|
||||||
% port.uf.tot/inc/ref total, incoming and reflected voltage
|
% port.uf.tot/inc/ref total, incoming and reflected voltage
|
||||||
% port.if.tot/inc/ref total, incoming and reflected current
|
% port.if.tot/inc/ref total, incoming and reflected current
|
||||||
|
@ -96,6 +103,13 @@ end
|
||||||
% read time domain data (multiples files)
|
% read time domain data (multiples files)
|
||||||
I = ReadUI( port.I_filename, SimDir, f, UI_args{:} );
|
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
|
% store the original frequency domain waveforms
|
||||||
u_f = U.FD{2}.val;
|
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
|
i_f = switch_dir*(I.FD{1}.val + I.FD{2}.val) / 2; % shift to same position as v
|
||||||
|
|
|
@ -24,6 +24,13 @@ function [port] = calcWGPort( port, SimDir, f, varargin)
|
||||||
% 'SwitchDirection': 0/1, switch assumed direction of propagation
|
% 'SwitchDirection': 0/1, switch assumed direction of propagation
|
||||||
%
|
%
|
||||||
% output:
|
% 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.f the given frequency fector
|
||||||
% port.uf.tot/inc/ref total, incoming and reflected voltage
|
% port.uf.tot/inc/ref total, incoming and reflected voltage
|
||||||
% port.if.tot/inc/ref total, incoming and reflected current
|
% 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;
|
u_f = U.FD{1}.val;
|
||||||
i_f = I.FD{1}.val * switch_dir;
|
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
|
physical_constants
|
||||||
k = 2*pi*f/C0*ref_index;
|
k = 2*pi*f/C0*ref_index;
|
||||||
fc = C0*port.kc/2/pi/ref_index;
|
fc = C0*port.kc/2/pi/ref_index;
|
||||||
|
|
Loading…
Reference in New Issue