#14 tanh function

closed
None
5
2011-07-16
2011-06-15
Anonymous
No

sinh() and cosh() are supported functions, but not tanh.
Unfortunatly, some foundries also used tanh() , the hyperbolic tangeant, in their models.
NGspice would then offer a better support with the integration of tanh() function.
Thanks, Rgds,
Guy

Discussion

  • Robert Larice

    Robert Larice - 2011-06-18

    Hello Guy,

    could you please be a bit more specific,
    if possible please attach a simple testcase.
    There are several parsers in ngspice.
    I'm not aware where`tanh' might be missing.

    Thank You
    Robert

     
  • Holger Vogt

    Holger Vogt - 2011-07-13

    Guy,

    we do have tanh in .param, .func statements and in behavioral B (E, G) sources.
    We do not have tanh in .control ... .endc sections (nor do we have sinh, cosh).
    See test below.

    Holger

    Input:

    tanh test
    *
    .param th = tanh(1)
    .func tfh(x) 'tanh(x)'
    .param th2 = tfh(-2)
    *
    .tran 1e-2 2
    *
    bvtanh 1 0 V=tanh(v(2))
    bv2 2 0 v = TIME - 1
    vt3 3 0 'th'
    vt4 4 0 'th2'
    vt5 5 0 'tfh(2)'
    *
    .control
    run
    let vtanh3 = tanh(5)
    *echo tanh(5): "$&vtanh3"
    .endc
    .end

    Output:

    Node Voltage
    ---- -------
    1 -0.761594
    2 -1
    3 0.761594
    4 -0.964028
    5 0.964028
    bv2#branch 0
    bvtanh#branch 0
    vt5#branch 0
    vt4#branch 0
    vt3#branch 0

    No. of Data Rows : 208
    Error: no such function as tanh.
    ngspice 1 ->

     
  • Holger Vogt

    Holger Vogt - 2011-07-16
    • assigned_to: nobody --> h_vogt
    • status: open --> closed
     
  • Holger Vogt

    Holger Vogt - 2011-07-16

    I have added sinh, cosh, tanh to the list of functions for scripting (inside .control ... .endc)

    Holger

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks