• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. PSpice
  3. How to solve this problem in simulation?

Stats

  • State Not Answered
  • Replies 4
  • Subscribers 27
  • Views 14680
  • Members are here 0
More Content

How to solve this problem in simulation?

qqplasm
qqplasm over 5 years ago

Here is the model code:

* PSpice Model Editor - Version 17.2.0
.SUBCKT Cj NP NN 
.PARAM C0=2.1E-13
.PARAM V0=2.7
.PARAM a=0.7
.PARAM ISS=56.19E-6
.PARAM Vb={a*V0}
.FUNC Csc(X) {IF(V<Vb,C0/SQRT(1-V/V0),C0*SQRT((1-a)^3)*(1-1.5*a+0.5*V/V0)}
***** BEGIN CIRCUIT *****
*SCH SECTION
.MODEL DSCH D (IS={ISS} N=2 RS=0.45)
DS NP NN DSCH
GCsc NP NN VALUE={Csc(V(NP)-V(NN))*DDT(V(NP)-V(NN))}
.ENDS
 

Here is my simulation proble:

*** FROM LIBRARY ../../../cj.lib ****
.SUBCKT Cj NP NN 

.PARAM C0=2.1E-13
.PARAM V0=2.7
.PARAM a=0.7
.PARAM ISS=56.19E-6
.PARAM Vb={a*V0}

.FUNC Csc(X) {IF(V<Vb,C0/SQRT(1-V/V0),C0*SQRT((1-a)^3)*(1-1.5*a+0.5*V/V0)}

***** BEGIN CIRCUIT *****
*SCH SECTION

-------------$
ERROR(ORPSIM-16367): End of expression not seen
DS NP NN DSCH
------------------------------------$
ERROR(ORPSIM-16367): End of expression not seen
DS NP NN DSCH
------------------------------------$
ERROR(ORPSIM-16367): End of expression not seen
GCsc NP NN VALUE={Csc(V(NP)-V(NN))*DDT(V(NP)-V(NN))}


------------------------------------$
ERROR(ORPSIM-16367): End of expression not seen
.ENDS
*$
------------------------------------$
ERROR(ORPSIM-16499): Missing .ENDS in .SUBCKT

 

Can anyone help me with this problem for my simulation? Many thanks!!

  • Sign in to reply
  • Cancel
  • oldmouldy
    0 oldmouldy over 5 years ago

    Your function is likely invalid. "^" in PSpice expressions is Boolean XOR, I suspect that you actually need PWR, or PWRS, to raise a variable by a power. (See the PSpice Users Guide) Also, your Csc function has an X parameter "passed in" but X isn't used anywhere in the function expression.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • qqplasm
    0 qqplasm over 5 years ago in reply to oldmouldy

    I modified the model based on your advice:

    * PSpice Model Editor - Version 17.2.0
    .SUBCKT Cj NP NN
    .PARAM C0=2.1E-13
    .PARAM V0=2.7
    .PARAM a=0.7
    .PARAM ISS=56.19E-6
    .PARAM Vb={a*V0}
    .FUNC Csc(X) {IF(X<Vb,C0/SQRT(1-X/V0),C0*SQRT((1-a)*(1-a)*(1-a))*(1-1.5*a+0.5*X/V0)}
    ***** BEGIN CIRCUIT *****
    *SCH SECTION
    .MODEL DSCH D (IS={ISS} N=2 RS=0.45)
    DS NP NN DSCH
    GCsc NP NN VALUE={Csc(V(NP)-V(NN))*DDT(V(NP)-V(NN))}
    .ENDS

    But the result still the same:

    **** FROM LIBRARY ../../../cj.lib ****
    .SUBCKT Cj NP NN
    .PARAM C0=2.1E-13
    .PARAM V0=2.7
    .PARAM a=0.7
    .PARAM ISS=56.19E-6
    .PARAM Vb={a*V0}
    .FUNC Csc(X) {IF(X<Vb,C0/SQRT(1-X/V0),C0*SQRT((1-a)*(1-a)*(1-a))*(1-1.5*a+0.5*X/V0)}
    ***** BEGIN CIRCUIT *****
    *SCH SECTION
    -------------$
    ERROR(ORPSIM-16367): End of expression not seen
    DS NP NN DSCH
    ------------------------------------$
    ERROR(ORPSIM-16367): End of expression not seen
    DS NP NN DSCH
    ------------------------------------$
    ERROR(ORPSIM-16367): End of expression not seen
    GCsc NP NN VALUE={Csc(V(NP)-V(NN))*DDT(V(NP)-V(NN))}
    ------------------------------------$
    ERROR(ORPSIM-16367): End of expression not seen
    .ENDS
    *
    ------------------------------------$
    ERROR(ORPSIM-16499): Missing .ENDS in .SUBCKT

    I did put .ENDS in the end of the model and the expression is complete. Could you help me with this problem?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • qqplasm
    0 qqplasm over 5 years ago in reply to oldmouldy

    I modified the model base on your advice.

    .FUNC Csc(X) {IF(X<Vb,C0/SQRT(1-X/V0),C0*SQRT((1-a)*(1-a)*(1-a))*(1-1.5*a+0.5*X/V0)}

    But the simulation result is exactly the same.

    I did put an .ENDS in the end of the model and the expression is complete. I don't understand why the errors keep show up. Could you please help me with the problem?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • oldmouldy
    0 oldmouldy over 5 years ago in reply to qqplasm

    The IF statement is missing a closing bracket at the right hand side.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information