The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 7th, 2024, 9:18pm
Pages: 1
Send Topic Print
model of capacitor, controlled with voltage need (Read 5290 times)
stary
New Member
*
Offline



Posts: 5

model of capacitor, controlled with voltage need
Oct 06th, 2006, 6:13am
 
Gurus, please, help me!
I want to use a voltage-controlled capacitor of type:
c = c0 + k*V(vc1, vc2)
here c0 and k are constants; vc1, vc2 - controlling nodes. So I try to describe it as:

I(vp,vn) <+ ddt( (c0 + k*V(vc1, vc2)) * V(vp,vn));   // (vp and vn are own nodes of capacitor)

But the compiler puts an error (rather long message). The main reason, as I understood, is mix of controlling and own voltages in one exepression. How it can be written in other form?
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: model of capacitor, controlled with voltage ne
Reply #1 - Oct 6th, 2006, 10:30am
 
If you are asking us to interpret an error message for you, it is helpful if you include the message in your post. Even better would be to include your model and perhaps a test circuit that exhibits the problem as well.

Have you taken a look at http://www.designers-guide.org/Modeling/varactors.pdf?

-Ken
Back to top
 
 
View Profile WWW   IP Logged
stary
New Member
*
Offline



Posts: 5

Re: model of capacitor, controlled with voltage ne
Reply #2 - Oct 8th, 2006, 10:54pm
 
Hi, Ken

I want to simulate a capacitor, linearly controlled with a voltage:
c = c0 + k*V(vc1,vc2)
here:
   c0 - initial capacitance,
   k   - a constant
   vc1, vc2 - the controlling nodes of capacitor
and this capacitor placed between nodes vp and vn. According to your paper I changed model of this capacitor on:

I(vp,vn) <+ ddt(c*V(vp,vn)+k*V(vc1,vc2)*V(vp,vn)*V(vp,vn)*0.5)

(i.e., I(vp,vn) is calculated via charge-based model.)
Again I get an compiler' error:

dynamic quantities must be linearity accessible.

What is the reason of error and how it can be fixed?
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: model of capacitor, controlled with voltage ne
Reply #3 - Oct 8th, 2006, 11:38pm
 
I don't know. Your model seems fine to me. What does your vendor say?

-Ken
Back to top
 
 
View Profile WWW   IP Logged
stary
New Member
*
Offline



Posts: 5

Re: model of capacitor, controlled with voltage ne
Reply #4 - Oct 9th, 2006, 12:29am
 
Oh, Ken, you don't sleep?!
Unfortunately, no access to vendor.
If it can help, the full text of model is:
`include "discipline.h"
`include "constants.h"
model cap1 (vp, vn, vc1, vc2);
inout vp, vn;
input vc1, vc2;
electrical vp, vn, vc1, vc2;
parameter real c = 0;
parameter real k = 0;
analog
    I(vp,vn) <+ ddt (c*V(vp, vn) + k*V(vc1, vc2)**V(vp, vn)*V(vp, vn)*0.5);
endmodule
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: model of capacitor, controlled with voltage ne
Reply #5 - Oct 9th, 2006, 6:09am
 
stary wrote on Oct 9th, 2006, 12:29am:
model cap1 (vp, vn, vc1, vc2);

s/model/module ?

Quote:
I(vp,vn) <+ ddt (c*V(vp, vn) + k*V(vc1, vc2)**V(vp, vn)*V(vp, vn)*0.5);

Did you intend the ** in there?

My compiler has no problem with the module.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
stary
New Member
*
Offline



Posts: 5

Re: model of capacitor, controlled with voltage ne
Reply #6 - Oct 9th, 2006, 6:21am
 
Yes, I did mistake when typing this text here, valid line is:

I(vp,vn) <+ ddt (c*V(vp, vn) + k*V(vc1, vc2)*V(vp, vn)*V(vp, vn)*0.5);

Version of software is: Virtuoso 5.1041_USR3.27.30

I cannot say exactly - s/model/module. It is a model of one of circuit's block.
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: model of capacitor, controlled with voltage ne
Reply #7 - Oct 9th, 2006, 8:06am
 
This appears to be a bug in the simulator. I was able to work around it by assigning the argument of ddt() to a local variable, and then applying ddt() to that variable. So in particular, I used
Code:
`include "discipline.h"
`include "constants.h"

module cap1 (vp, vn, vc1, vc2);
inout vp, vn;
input vc1, vc2;
electrical vp, vn, vc1, vc2;
parameter real c = 0;
parameter real k = 0;
real q;
analog begin
    q = c*V(vp, vn) + k*V(vc1, vc2)*V(vp, vn)*V(vp, vn)*0.5;
    I(vp,vn) <+ ddt (q);
end
endmodule  

and it compiled without finding any errors.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.