source: src/main/java/agents/anac/y2015/agentBuyogV2/flanagan/circuits/CoaxialLine.java

Last change on this file was 127, checked in by Wouter Pasman, 6 years ago

#41 ROLL BACK of rev.126 . So this version is equal to rev. 125

File size: 15.7 KB
Line 
1/* Class CoaxialLine
2*
3* Models a coaxial transmission line
4* This is a subclass of the superclass TransmissionLine
5*
6* WRITTEN BY: Dr Michael Thomas Flanagan
7*
8* DATE: July 2007
9* UPDATE: 7 April 2008
10*
11* DOCUMENTATION:
12* See Michael T Flanagan's Java library on-line web pages:
13* http://www.ee.ucl.ac.uk/~mflanaga/java/CoaxialLine.html
14* http://www.ee.ucl.ac.uk/~mflanaga/java/TransmissionLine.html
15* http://www.ee.ucl.ac.uk/~mflanaga/java/
16*
17* Copyright (c) 2007 - 2008 Michael Thomas Flanagan
18*
19* PERMISSION TO COPY:
20* Permission to use, copy and modify this software and its documentation for
21* NON-COMMERCIAL purposes is granted, without fee, provided that an acknowledgement
22* to the author, Michael Thomas Flanagan at www.ee.ucl.ac.uk/~mflanaga, appears in all copies.
23*
24* Dr Michael Thomas Flanagan makes no representations about the suitability
25* or fitness of the software for any or for a particular purpose.
26* Michael Thomas Flanagan shall not be liable for any damages suffered
27* as a result of using, modifying or distributing this software or its derivatives.
28*
29***************************************************************************************/
30
31package agents.anac.y2015.agentBuyogV2.flanagan.circuits;
32
33import agents.anac.y2015.agentBuyogV2.flanagan.complex.Complex;
34
35public class CoaxialLine extends TransmissionLine{
36
37 private double innerRadius = -1.0D; // inner radius - coaxial centre to outer surface of inner conductor
38 private double outerRadius = -1.0D; // outer radius - coaxial centre to inner surface of outer conductor
39 private boolean radiiSet = false; // = true when both inner and outer radii entered
40
41 private double relativePermittivity = 1.0D; // relative electrical permittivity of the material between the conductors
42 private double relativePermeability = 1.0D; // relative magnetic permeability of the material between the conductors
43
44
45 // CONSTRUCTOR
46 // default constructor
47 public CoaxialLine(){
48 super.title = "Coaxial Line";
49 }
50
51 // user provided title
52 public CoaxialLine(String title){
53 super.title = title;
54 }
55
56 // RADII
57 // Set inner and outer radii
58 // inner: coaxial centre to outer surface of inner conductor
59 // outer: coaxial centre to inner surface of outer conductor
60 public void setRadii(double innerRadius, double outerRadius){
61 if(innerRadius<=0.0D)throw new IllegalArgumentException("The inner radius, " + innerRadius + ", must be greater than zero");
62 if(outerRadius<=0.0D)throw new IllegalArgumentException("The outer radius, " + outerRadius + ", must be greater than zero");
63 if(innerRadius >= outerRadius)throw new IllegalArgumentException("The inner radius, " + innerRadius + ", must be less than the outer radius, " + outerRadius);
64 this.innerRadius = innerRadius;
65 this.outerRadius = outerRadius;
66 this.radiiSet = true;
67 this.calculateDistributedCapacitanceAndInductance();
68 }
69
70 // Set inner radius - coaxial centre to outer surface of inner conductor
71 public void setInnerRadius(double radius){
72 if(radius<=0.0D)throw new IllegalArgumentException("The inner radius, " + radius + ", must be greater than zero");
73 if(this.outerRadius!=-1.0D && this.outerRadius<=radius)throw new IllegalArgumentException("The inner radius, " + radius + ", must be less than the outer radius, " + this.outerRadius);
74 this.innerRadius = radius;
75 if(this.outerRadius!=-1.0)this.radiiSet = true;
76 if(this.radiiSet)this.calculateDistributedCapacitanceAndInductance();
77 }
78
79 // Set outer radius - coaxial centre to inner surface of outer conductor
80 public void setOuterRadius(double radius){
81 if(radius<=0.0D)throw new IllegalArgumentException("The outer radius, " + radius + ", must be greater than zero");
82 if(this.innerRadius!=-1.0D && this.innerRadius>=radius)throw new IllegalArgumentException("The outer radius, " + radius + ", must be greater than the inner radius, " + this.innerRadius);
83 this.outerRadius = radius;
84 if(this.innerRadius!=-1.0)this.radiiSet = true;
85 if(this.radiiSet)this.calculateDistributedCapacitanceAndInductance();
86 }
87
88 // PERMITTIVITY
89 // Set relative electrical permittivity of the material between the conductors
90 public void setRelativePermittivity(double epsilonR){
91 this.relativePermittivity = epsilonR;
92 if(this.radiiSet)this.calculateDistributedCapacitanceAndInductance();
93 }
94
95 // PERMEABILTY
96 // Set relative magnetic permeability of the material between the conductors
97 public void setRelativePermeability(double muR){
98 this.relativePermeability = muR;
99 if(this.radiiSet)this.calculateDistributedCapacitanceAndInductance();
100 }
101
102 // CALCULATE DISTRIBUTED PARAMETERS
103 private void calculateDistributedCapacitanceAndInductance(){
104 super.distributedCapacitance = Impedance.coaxialCapacitance(1.0D, this.innerRadius, this.outerRadius, this.relativePermittivity);
105 super.distributedInductance = Impedance.coaxialInductance(1.0D, this.innerRadius, this.outerRadius, this.relativePermeability);
106 }
107
108 // DEEP COPY
109 public CoaxialLine copy(){
110
111 if(this==null){
112 return null;
113 }
114 else{
115 CoaxialLine tl = new CoaxialLine();
116
117 tl.innerRadius = this.innerRadius;
118 tl.outerRadius = this.outerRadius;
119 tl.radiiSet = this.radiiSet;
120 tl.relativePermittivity = this.relativePermittivity;
121 tl.relativePermeability = this.relativePermeability;
122
123 tl.title = this.title;
124 tl.distributedResistance = this.distributedResistance;
125 tl.distributedConductance = this.distributedConductance;
126 tl.distributedCapacitance = this.distributedCapacitance;
127 tl.distributedInductance = this.distributedInductance;
128
129 tl.distributedImpedance = this.distributedImpedance.copy();
130 tl.distributedAdmittance = this.distributedAdmittance.copy();
131 tl.loadImpedance = this.loadImpedance.copy();
132
133 tl.lineLength = this.lineLength;
134 tl.segmentLength = this.segmentLength;
135 tl.frequency = this.frequency;
136 tl.segmentLength = this.segmentLength;
137 tl.omega = this.omega;
138
139 tl.inputVoltage = this.inputVoltage.copy();
140 tl.inputCurrent = this.inputCurrent.copy();
141 tl.outputVoltage = this.outputVoltage.copy();
142 tl.outputCurrent = this.outputCurrent.copy();
143
144 tl.idealWavelength = this.idealWavelength;
145 tl.generalWavelength = this.generalWavelength;
146 tl.lowLossWavelength = this.lowLossWavelength;
147
148 tl.idealPhaseVelocity = this.idealPhaseVelocity;
149 tl.generalPhaseVelocity = this.generalPhaseVelocity;
150 tl.lowLossPhaseVelocity = this.lowLossPhaseVelocity;
151
152 tl.idealGroupVelocity = this.idealGroupVelocity;
153 tl.generalGroupVelocity = this.generalGroupVelocity;
154 tl.lowLossGroupVelocity = this.lowLossGroupVelocity;
155 tl.delta = this.delta;
156
157 tl.idealAttenuationConstant = this.idealAttenuationConstant;
158 tl.generalAttenuationConstant = this.generalAttenuationConstant;
159 tl.lowLossAttenuationConstant = this.lowLossAttenuationConstant;
160
161 tl.idealPhaseConstant = this.idealPhaseConstant;
162 tl.generalPhaseConstant = this.generalPhaseConstant;
163 tl.lowLossPhaseConstant = this.lowLossPhaseConstant;
164
165 tl.idealPropagationConstant = this.idealPropagationConstant.copy();
166 tl.loadImpedance = this.loadImpedance.copy();
167 tl.loadImpedance = this.loadImpedance.copy();
168 tl.loadImpedance = this.loadImpedance.copy();
169
170 tl.generalPropagationConstant = this.generalPropagationConstant.copy();
171 tl.lowLossPropagationConstant = this.lowLossPropagationConstant.copy();
172 tl.idealCharacteristicImpedance = this.idealCharacteristicImpedance.copy();
173 tl.idealRealCharacteristicImpedance = this.idealRealCharacteristicImpedance;
174
175 tl.generalCharacteristicImpedance = this.generalCharacteristicImpedance.copy();
176 tl.lowLossCharacteristicImpedance = this.lowLossCharacteristicImpedance.copy();
177 tl.idealInputImpedance = this.idealInputImpedance.copy();
178 tl.generalInputImpedance = this.generalInputImpedance.copy();
179 tl.lowLossInputImpedance = this.lowLossInputImpedance.copy();
180
181 tl.idealShortedLineImpedance = this.idealShortedLineImpedance.copy();
182 tl.generalShortedLineImpedance = this.generalShortedLineImpedance.copy();
183 tl.lowLossShortedLineImpedance = this.lowLossShortedLineImpedance.copy();
184
185 tl.idealOpenLineImpedance = this.idealOpenLineImpedance.copy();
186 tl.generalOpenLineImpedance = this.generalOpenLineImpedance.copy();
187 tl.lowLossOpenLineImpedance = this.lowLossOpenLineImpedance.copy();
188
189 tl.idealQuarterWaveLineImpedance = this.idealQuarterWaveLineImpedance.copy();
190 tl.generalQuarterWaveLineImpedance = this.generalQuarterWaveLineImpedance.copy();
191 tl.lowLossQuarterWaveLineImpedance = this.lowLossQuarterWaveLineImpedance.copy();
192
193 tl.idealHalfWaveLineImpedance = this.idealHalfWaveLineImpedance.copy();
194 tl.generalHalfWaveLineImpedance = this.generalHalfWaveLineImpedance.copy();
195 tl.lowLossHalfWaveLineImpedance = this.lowLossHalfWaveLineImpedance.copy();
196
197 tl.idealRefectionCoefficient = this.idealRefectionCoefficient.copy();
198 tl.generalRefectionCoefficient = this.generalRefectionCoefficient.copy();
199 tl.lowLossRefectionCoefficient = this.lowLossRefectionCoefficient.copy();
200
201 tl.idealStandingWaveRatio = this.idealStandingWaveRatio;
202 tl.generalStandingWaveRatio = this.generalStandingWaveRatio;
203 tl.lowLossStandingWaveRatio = this.lowLossStandingWaveRatio;
204
205 tl.idealABCDmatrix = this.idealABCDmatrix.copy();
206 tl.generalABCDmatrix = this.generalABCDmatrix.copy();
207 tl.lowLossABCDmatrix = this.lowLossABCDmatrix.copy();
208
209 tl.numberOfPoints = this.numberOfPoints;
210
211 return tl;
212 }
213 }
214
215
216 // Clone - overrides Java.Object method clone
217 public Object clone(){
218
219 Object ret = null;
220
221 if(this!=null){
222
223 CoaxialLine tl = new CoaxialLine();
224
225 tl.innerRadius = this.innerRadius;
226 tl.outerRadius = this.outerRadius;
227 tl.radiiSet = this.radiiSet;
228 tl.relativePermittivity = this.relativePermittivity;
229 tl.relativePermeability = this.relativePermeability;
230
231 tl.title = this.title;
232 tl.distributedResistance = this.distributedResistance;
233 tl.distributedConductance = this.distributedConductance;
234 tl.distributedCapacitance = this.distributedCapacitance;
235 tl.distributedInductance = this.distributedInductance;
236
237 tl.distributedImpedance = this.distributedImpedance.copy();
238 tl.distributedAdmittance = this.distributedAdmittance.copy();
239 tl.loadImpedance = this.loadImpedance.copy();
240
241 tl.lineLength = this.lineLength;
242 tl.segmentLength = this.segmentLength;
243 tl.frequency = this.frequency;
244 tl.segmentLength = this.segmentLength;
245 tl.omega = this.omega;
246
247 tl.inputVoltage = this.inputVoltage.copy();
248 tl.inputCurrent = this.inputCurrent.copy();
249 tl.outputVoltage = this.outputVoltage.copy();
250 tl.outputCurrent = this.outputCurrent.copy();
251
252 tl.idealWavelength = this.idealWavelength;
253 tl.generalWavelength = this.generalWavelength;
254 tl.lowLossWavelength = this.lowLossWavelength;
255
256 tl.idealPhaseVelocity = this.idealPhaseVelocity;
257 tl.generalPhaseVelocity = this.generalPhaseVelocity;
258 tl.lowLossPhaseVelocity = this.lowLossPhaseVelocity;
259
260 tl.idealGroupVelocity = this.idealGroupVelocity;
261 tl.generalGroupVelocity = this.generalGroupVelocity;
262 tl.lowLossGroupVelocity = this.lowLossGroupVelocity;
263 tl.delta = this.delta;
264
265 tl.idealAttenuationConstant = this.idealAttenuationConstant;
266 tl.generalAttenuationConstant = this.generalAttenuationConstant;
267 tl.lowLossAttenuationConstant = this.lowLossAttenuationConstant;
268
269 tl.idealPhaseConstant = this.idealPhaseConstant;
270 tl.generalPhaseConstant = this.generalPhaseConstant;
271 tl.lowLossPhaseConstant = this.lowLossPhaseConstant;
272
273 tl.idealPropagationConstant = this.idealPropagationConstant.copy();
274 tl.loadImpedance = this.loadImpedance.copy();
275 tl.loadImpedance = this.loadImpedance.copy();
276 tl.loadImpedance = this.loadImpedance.copy();
277
278 tl.generalPropagationConstant = this.generalPropagationConstant.copy();
279 tl.lowLossPropagationConstant = this.lowLossPropagationConstant.copy();
280 tl.idealCharacteristicImpedance = this.idealCharacteristicImpedance.copy();
281 tl.idealRealCharacteristicImpedance = this.idealRealCharacteristicImpedance;
282
283 tl.generalCharacteristicImpedance = this.generalCharacteristicImpedance.copy();
284 tl.lowLossCharacteristicImpedance = this.lowLossCharacteristicImpedance.copy();
285 tl.idealInputImpedance = this.idealInputImpedance.copy();
286 tl.generalInputImpedance = this.generalInputImpedance.copy();
287 tl.lowLossInputImpedance = this.lowLossInputImpedance.copy();
288
289 tl.idealShortedLineImpedance = this.idealShortedLineImpedance.copy();
290 tl.generalShortedLineImpedance = this.generalShortedLineImpedance.copy();
291 tl.lowLossShortedLineImpedance = this.lowLossShortedLineImpedance.copy();
292
293 tl.idealOpenLineImpedance = this.idealOpenLineImpedance.copy();
294 tl.generalOpenLineImpedance = this.generalOpenLineImpedance.copy();
295 tl.lowLossOpenLineImpedance = this.lowLossOpenLineImpedance.copy();
296
297 tl.idealQuarterWaveLineImpedance = this.idealQuarterWaveLineImpedance.copy();
298 tl.generalQuarterWaveLineImpedance = this.generalQuarterWaveLineImpedance.copy();
299 tl.lowLossQuarterWaveLineImpedance = this.lowLossQuarterWaveLineImpedance.copy();
300
301 tl.idealHalfWaveLineImpedance = this.idealHalfWaveLineImpedance.copy();
302 tl.generalHalfWaveLineImpedance = this.generalHalfWaveLineImpedance.copy();
303 tl.lowLossHalfWaveLineImpedance = this.lowLossHalfWaveLineImpedance.copy();
304
305 tl.idealRefectionCoefficient = this.idealRefectionCoefficient.copy();
306 tl.generalRefectionCoefficient = this.generalRefectionCoefficient.copy();
307 tl.lowLossRefectionCoefficient = this.lowLossRefectionCoefficient.copy();
308
309 tl.idealStandingWaveRatio = this.idealStandingWaveRatio;
310 tl.generalStandingWaveRatio = this.generalStandingWaveRatio;
311 tl.lowLossStandingWaveRatio = this.lowLossStandingWaveRatio;
312
313 tl.idealABCDmatrix = this.idealABCDmatrix.copy();
314 tl.generalABCDmatrix = this.generalABCDmatrix.copy();
315 tl.lowLossABCDmatrix = this.lowLossABCDmatrix.copy();
316
317 tl.numberOfPoints = this.numberOfPoints;
318
319 ret = (Object)tl;
320 }
321 return ret;
322 }
323}
Note: See TracBrowser for help on using the repository browser.