From 5d68e6de44ada8f5d8eb268bd933765d3058390b Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Wed, 11 Apr 2012 11:49:45 +0200 Subject: [PATCH] matlab: fixes for LumpedPort using R=0 bug: if no excitation was specified and R=0, port would act as open instead of a short-circuit fix: create metal box for R=0 and just always use a soft excitation Signed-off-by: Thorsten Liebig --- matlab/AddLumpedPort.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/matlab/AddLumpedPort.m b/matlab/AddLumpedPort.m index d14aa63..0aa65f6 100644 --- a/matlab/AddLumpedPort.m +++ b/matlab/AddLumpedPort.m @@ -53,11 +53,14 @@ end if (R>0) CSX = AddLumpedElement(CSX,['port_resist_' int2str(portnr)], n_dir-1, 'Caps', 1, 'R', R); CSX = AddBox(CSX,['port_resist_' int2str(portnr)], prio, start, stop); +else + CSX = AddMetal(CSX,['port_resist_' int2str(portnr)]); + CSX = AddBox(CSX,['port_resist_' int2str(portnr)], prio, start, stop); end % create excitation if (nargin >= 8) && ~isempty(excitename) - CSX = AddExcitation( CSX, excitename, R<=0, -dir*direction, varargin{:}); + CSX = AddExcitation( CSX, excitename, 0, -dir*direction, varargin{:}); CSX = AddBox( CSX, excitename, prio, start, stop ); end