Hyperbolic tangent

Hello everyone,
There is a way to use hyperbolic functions. I should calculate the hyperbolic tangent of a value.
Can I import it by means of libraries? Banally if I use tanh(x) it tells me that tanh is not defined.
Thanks in advance.
Lorenzo

Basic hyperbolic functions are included in UFL so you should be able to use them.

2 Likes

I was sure but once I import the UFL package I get this output

phi_c3 = tanh(3*phi_old)+1
NameError: name 'tanh' is not defined. Did you mean: 'tan'?

Uh, ok sorry for the confussion. The function is working for me. Could it be a multiple import problem due to a wildcard import?

Solved, I made a trivial mistake. Thank you.
Lorenzo

1 Like