• 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. There is something wrong with my device model, which always...

Stats

  • State Suggested Answer
  • Replies 6
  • Answers 1
  • Subscribers 27
  • Views 2594
  • Members are here 0
More Content

There is something wrong with my device model, which always leads to mistakes in simulation, but I don't know where the mistakes are.

JQ202504092110
JQ202504092110 5 months ago

This is my PSPICE model:

.SUBCKT MEMRISTOR 1 2
Cx 3 0 1e-9 IC=0.314
Rx 3 0 1G
Vstp TIME 0 PULSE(0 1 0 1ns 1ns 1s 2s)
E_stp 4 0 VALUE { IF(TIME > 0, 0, 1) }
B_fx 5 0 V=1 - ( (0.9 * (V(3) - V(4)) ** 2 + 0.1) ) ** 10
Gx 0 3 VALUE { 1e-14 * 100 / (10e-9)**2 * I(Vsense) * V(5) }
E_Rmem 6 0 VALUE { 16e3 - V(3) * (16e3 - 100) }
Rmem 6 7 1
Vsense 1 7 DC 0
Rout 2 7 1e-12
.ENDS MEMRISTOR

This error occurred during my simulation:But I don't know what's wrong. Please help me analyze it.

ERROR(ORPSIM-16152): Invalid number: Error while converting token '-' to double value. Token can be a constant or expression

  • Sign in to reply
  • Cancel
Parents
  • oldmouldy
    0 oldmouldy 5 months ago

    You have a B device for "B_fx" which is SPICE 3 and PSpice is SPICE 2. Since this B device is generating a Voltage, you can use an Evalue, like the other E devices, to replace the B device.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JQ202504092110
    0 JQ202504092110 5 months ago in reply to oldmouldy

    When I changed B_fx to E, there was a new error:

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JQ202504092110
    0 JQ202504092110 5 months ago in reply to JQ202504092110

    Does this also need to be defined by value?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • oldmouldy
    0 oldmouldy 5 months ago in reply to JQ202504092110

    In addition to the "B" device change, you have also changed Rmem to have be a voltage varying device which isn't supported by SPICE 2 (And PSpice). Search the Cadence Support site for modelling Voltage controlled Capacitors and Resistors for a solution.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • oldmouldy
    0 oldmouldy 5 months ago in reply to JQ202504092110

    In addition to the "B" device change, you have also changed Rmem to have be a voltage varying device which isn't supported by SPICE 2 (And PSpice). Search the Cadence Support site for modelling Voltage controlled Capacitors and Resistors for a solution.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
No Data
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