Home > Community > Forums > Feedback, Suggestions, and Questions > AC Sweep - how to include frequency in a parameter's expression?

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 AC Sweep - how to include frequency in a parameter's expression? 

Last post Mon, Jan 13 2014 3:26 AM by npw1. 3 replies.
Started by npw1 26 Feb 2013 08:37 AM. Topic has 3 replies and 1194 views
Page 1 of 1 (4 items)
Sort Posts:
  • Tue, Feb 26 2013 8:37 AM

    • npw1
    • Not Ranked
    • Joined on Tue, Feb 26 2013
    • Posts 5
    • Points 40
    AC Sweep - how to include frequency in a parameter's expression? Reply

    Hi,

     I'm trying to specify a frequency dependent resistance (an approximation of the skin effect).

    I have a parameters include file, and need to specify the frequency within an expression (in curly brackets) as follows:

    S3_skin_tu1 = {PI*PWR(S3_r_tu1-SQRT(2*S3_res_tu1/(2*PI*FREQUENCY*u_Cu)),2)}

    However, PSpice does not understand 'FREQUENCY' (nor 'FREQ' or anything else I've tried). I've not been able to find anything in the documentation.

    Does anyone know of a way to use AC frequency in an expression?

    Any suggestions will be gratefully received!

    Regards,

    Nick

    • Post Points: 20
  • Wed, Feb 27 2013 1:19 AM

    • NickW
    • Not Ranked
    • Joined on Wed, Aug 8 2012
    • Posts 10
    • Points 140
    Re: AC Sweep - how to include frequency in a parameter's expression? Reply

    I put a frequency into the expression numerically and examined the output at that particular frequency (the output at other frequencies would now be incorrect though). Doing this told me what I needed to know.

    I may need to revisit this in the future, and it is still an interesting question! How to get 'frequency' into a parameter's expression symbolically?

    One document suggested that the AC skin effect of a conductor could be simulated by using resistors and inductors.

    Another idea is to sense the current through a 1H inductor when 1 volt is applied accross it [frequency given by 1/(2*PI*CURRENT)] but how to pass this CURRENT into an expression?

    Regards,

    Nick

    I am both NickW (home email) and npw1 (work email) - sorry for any confusion!

    • Post Points: 20
  • Tue, Jun 18 2013 1:43 AM

    • npw1
    • Not Ranked
    • Joined on Tue, Feb 26 2013
    • Posts 5
    • Points 40
    Re: AC Sweep - how to include frequency in a parameter's expression? Reply

     So to clarify what I do to simulate the skin effect...

    in my include file I have the following definitions:

    *  AC skin effect
    +  freq      = 6900
    +  ang_freq  = {2*PI*freq}
    +  mu0       = {4*PI*1E-7}
    +  mur_Cu    = 0.999994
    +  mur_Al    = 1.000022
    +  mu_Cu     = {mu0*mur_Cu}
    +  mu_Al     = {mu0*mur_Al}
    +  skin_Cu   = {SQRT(2*res_Cu/(ang_freq*mu_Cu))}
    +  skin_Al   = {SQRT(2*res_Al/(ang_freq*mu_Al))}

    giving the AC skin penetration depth for copper and aluminium, which is then used in later expressions.

    Typically I'll sweep frequency from 5000Hz to 9000Hz, but the AC skin effect is calculated using the 'freq' parameter (shown above as set to 6900Hz) so the PSpice frequency sweep output will only be accurate close to 6900Hz.

    To do an accurate frequency sweep I'd have to do separate runs while manually changing the 'freq' value each time.

    It must be within PSpice's ability to have 'freq' set to the actual AC frequency of the simulation!

    Anyone know how it can be done? If not, then I request this be added as a feature in a subsequent OrCAD update :)

    Regards,

    Nick

    • Post Points: 5
  • Mon, Jan 13 2014 3:26 AM

    • npw1
    • Not Ranked
    • Joined on Tue, Feb 26 2013
    • Posts 5
    • Points 40
    Re: AC Sweep - how to include frequency in a parameter's expression? Reply

     Hi,

    I've found out how to do this. For those who are interested:

     I've used an 'E' device (a controlled voltage source) as follows...

     E_DEVICE_NAME node1 node2 LAPLACE {I(E_DEVICE_NAME)} = {XFORM expression involving 's'}

    where the XFORM is:

    rho*length/(PI*PWR(radius,2)-PI*PWR(radius-SQRT(2*rho/(ABS(s)*mu)),2))

    rho=resistivity of conductor, radius=radius of conductor, mu=permeability of conductor

    The frequency dependent resistor device is between nodes 'node1' and 'node2'. The simulated source voltage is equal to I(E_DEVICE_NAME) (i.e. the current through the device) multiplied by the XFORM where 's' is replaced by j*omega (omega=2*pi*frequency) which evaluates to the resistance required.

    Note that here it is important that ABS(s) appear in the XFORM (rather than just 's') otherwise XFORM will be in general complex, and thus the device would have a reactance. Here I want the device to be purely resistive.

     Regards,

    Nick

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by npw1 at 26 Feb 2013 08:37 AM. Topic has 3 replies.