The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Design Languages >> Verilog-AMS >> question about probes and sources https://designers-guide.org/forum/YaBB.pl?num=1302534601 Message started by Zorro on Apr 11th, 2011, 8:10am |
Title: question about probes and sources Post by Zorro on Apr 11th, 2011, 8:10am Hi all, I'm a little confused about this: "It is not possible for a probe to simultaneously be a potential and flow probe, and so it is illegal to observe both the potential and flow of a probe branch." Designers Guide, page 61 near to the bottom. "A branch cannot simultaneously be both a potential and a flow source, ..." Designers Guide, page 62 near the top But then in page 59 near the top there is a model for a diode (listing 12) using this: l(a,c) <+ is*(limexp((V(a,c) – r*l(a,c))/$vt) – 1); i.e. the probe is monitoring both the voltage (potential probe V(a,c)) and the flow (flow probe I(a,c)) which is a contradiction to the note from page 61. Could please somebody explain this to me because I got confused. From page 64 I understand that I can have, for example: I(a, c) <+ V(a, c)*r1; I(a, c) <+ V(a, c)*r2; I(a, c) <+ V(a, c)*r3; ... that means a flow source (parallel branches, KCL) and potential probes but I cannot have this: I(a, c) <+ V(a, c)*r1; I(a, c) <+ V(a, c)*r2; V(a, c) <+ I(a, c)*r3; X error ... or that I can have this: V(a, c) <+ I(a, c)*r1; V(a, c) <+ I(a, c)*r2; V(a, c) <+ I(a, c)*r3; ... that means a potential source (branches in series, KVL) and flow probes but I cannot have this: V(a, c) <+ I(a, c)*r1; V(a, c) <+ I(a, c)*r2; I(a, c) <+ V(a, c)*r3; X error ... so the question is why is it possible to monitor (probe) both the current and the voltage in this equation: l(a,c) <+ is*(limexp((V(a,c) – r*l(a,c))/$vt) – 1); ??? I'm really confused and very grateful for any explanation. thank you! best regards! - Zorro |
Title: Re: question about probes and sources Post by boe on Apr 11th, 2011, 9:55am Zorro, Zorro wrote on Apr 11th, 2011, 8:10am:
B O E |
Title: Re: question about probes and sources Post by Ken Kundert on Apr 12th, 2011, 1:03am A branch ceases to be a probe branch once you contribute to it. So the branch from a to c in Code:
In a probe branch, either the voltage or the current is always zero depending on what type of probe branch it is. As such, the language uses what you are observing to determine what type of probe branch it is. That is why you cannot probe both (not only is it not useful, but it would hide your intent). None of this is true with source branches. The type is determine by what you contribute to, not what you probe. And both the voltage and current of a source branch are interesting and useful. And B.O.E is correct that the branch equation is an implicit formulation, but that does not affect what you can probe. -Ken |
Title: Re: question about probes and sources Post by Zorro on Apr 12th, 2011, 2:14am thank you for the reply. I also read that in the Designer's Guide Book about I(a,c) <+ is*(limexp((V(a,c) – r*l(a,c))/$vt) – 1) being an implicit equation. (page 59) What I don't understand is when such an assignation is allowed and where it is not. here is the reason why I am confused. please see the attached picture. I wanted to describe that network like this: component left side right side status I(ref, pole_gain) <+ V(inp, inm) * dc_gain/rp1; // vccs flow source potential branch ok V(pole_gain, ref) <+ I(pole_gain, ref) / rp1; // resistor potential source flow branch error I(pole_gain, ref) <+ ddt(cp1 * V(pole_gain, ref)); // capacitor flow source potential branch ok but it was not working as expected. then I read the section about sources and probes (section 4.2, page 60) and it says that "A branch cannot simultaneously be both a potential and a flow source" and that's is the case with the description of the resistor. I am using flow sources and potential sources to describe a branch which is not allowed. so I changed my code to this: component left side right side status I(ref, pole_gain) <+ V(inp, inm) * dc_gain/rp1; // vccs flow source potential branch ok I(pole_gain, ref) <+ V(pole_gain, ref) / rp1; // resistor potential source flow branch error I(pole_gain, ref) <+ ddt(cp1 * V(pole_gain, ref)); // capacitor flow source potential branch ok and correcto! now it's working as expected because I have flow sources and potential probes, and not a mix. now let's go back to this equation: I(a,c) <+ is*(limexp((V(a,c) – r*l(a,c))/$vt) – 1) let's make it simpler and let's say that it is similar to: I(a,c) <+ k1 * V(a,c) - k2 * I(a,c); I could re-write this equation: I(a,c) <+ k1 * V(a,c) flow source potential branch I(a,c) <+ - k2 * I(a,c); flow source flow branch so I have a mix at the right side which is not allowed: "It is not possible for a probe to simultaneously be a potential and flow probe, and so it is illegal to observe both the potential and flow of a probe branch." Designers Guide, page 61 near to the bottom. Could please somebody explain me. |
Title: Re: question about probes and sources Post by Zorro on Apr 12th, 2011, 2:16am picture |
Title: Re: question about probes and sources Post by Zorro on Apr 12th, 2011, 2:27am thanks kundert. one more question. please see the last picture. are both codes correct? code1: I(ref, pole_gain) <+ V(inp, inm) * dc_gain/rp1; I(pole_gain, ref) <+ V(pole_gain, ref) / rp1; I(pole_gain, ref) <+ ddt(cp1 * V(pole_gain, ref)); and code2: I(ref, pole_gain) <+ V(inp, inm) * dc_gain/rp1; V(pole_gain, ref) <+ I(pole_gain, ref) * rp1; I(pole_gain, ref) <+ ddt(cp1 * V(pole_gain, ref)); and this: "A branch ceases to be a probe branch once you contribute to it." is what I was missing. thank you! - Zorro |
Title: Re: question about probes and sources Post by Ken Kundert on Apr 13th, 2011, 12:19am Case 2 is illegal because you are simultaneously treating the branch between ref and pole_gain as a flow source and a potential source. Remember that if you make multiple contributions to a flow source it is as if you are adding branches in parallel (the flow sums). If you make multiple contributions to a potential source it is as if you are adding branches in series (the potential sums). Notice that this pattern does not generalize to mixed multiple contributions. Would they go in series or in parallel? How do you sum a flow and a potential? For these reasons, simultaneously contributing to the flow and potential of a branch is not allowed. From your picture it is clear that you want the components to be arranged in parallel. The only way to do this with unnamed branches is to use flow sources which naturally combine in parallel. If you want to mix the formulations for the branches, you will need to explicitly declare separate branches using a branch statement and formulate each independently. Thus, case 2 can be written: Code:
-Ken |
Title: Re: question about probes and sources Post by Zorro on Apr 14th, 2011, 1:44am thank you again for the explanation. to summarize: this is valid: I(a,c) <+ V(a,c)*k1; I(a,c) <+ I(a,c)*k2; the branches are in parallel and I could also say: I(a,c) <+ V(a,c)*k1 + I(a,c)*k2; (KCL) this is not valid: V(a,c) <+ I(a,c)*k1; I(a,c) <+ V(a,c)*k2; error, simultaneously treating the branch between "a" and "c" as a flow source and a potential source thank you! |
Title: Re: question about probes and sources Post by Zorro on Apr 14th, 2011, 1:59am Hi again, please see the attached picture with 3 resistances r1, r2, r3. code1: using named branches branch (a, x) res1, (x, c) res2, (a,c) res3; V(res1) <+ I(res1)*r1; V(res2) <+ I(res2)*r2; I(res3) <+ V(res3)/r3; code2: using unnamed branches I(a,x) <+ V(a,x)*r1; I(x,c) <+ V(x,c)*r2; I(a,c) <+ V(a,c)*r3; now a particular situation... let's say that I start my definition like this (using unnamed branches): V(a,c) <+ I(a,c)*r1+I(a,c)*r2; indicates that r1 and r2 are in series which is correct. now I need to describe the behavior of R3. Situation 1: if I add the second line to describe r3 like this: V(a,c) <+ I(a,c)*r1+I(a,c)*r2; V(a,c) <+ I(a,c)*r3; this is a mistake because it's like saying that r1, r2 and r3 are in series, which is false. Situation 2: if I add the second line to describe r3 like this: V(a,c) <+ I(a,c)*r1+I(a,c)*r2; I(a,c) <+ V(a,c)*r3; error, simultaneously treating the branch between "a" and "c" as a flow source and a potential source this means that if for any reason I start describing the network like this: V(a,c) <+ I(a,c)*r1+I(a,c)*r2; there is no option left to describe what happens on r3. this is just an example assuming extrictly that the description starts with: V(a,c) <+ I(a,c)*r1+I(a,c)*r2; can I do this? V(a,c) <+ I(a,c)*r1+I(a,c)*r2; // extrictly so, just for education/understanding purposes branch (a,c) res3; V(res3) <+ I(res3)*r3; i.e. using the nodes (a,c) first as an unnamed branch and then as a named branch. thank you! |
Title: Re: question about probes and sources Post by Ken Kundert on Apr 14th, 2011, 2:22am yes |
Title: Re: question about probes and sources Post by Zorro on Apr 14th, 2011, 3:29am ok! thanks kundert and BOE for all the explanations and verifications. best regards! |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |