[LON-CAPA-users] Hyperbolic Trig Function Problem

Harding, Gene L glhardin at purdue.edu
Wed Jan 29 21:02:06 EST 2020

Thanks Justin, that was a good idea. I tried it, but got the same results; also double-checked MATLAB’s result with Google. I was typing a longer response when I saw Stuart’s solution, but still want to say thank you. I had not thought of trying Maxima.

Stuart, thank you. You never cease to amaze me. I will make a note of that function call syntax for future reference.

Best regards,

Gene L. Harding, PE
Associate Professor of ECET
Purdue University

From: LON-CAPA-users <lon-capa-users-bounces at mail.lon-capa.org> On Behalf Of Justin Gray
Sent: Wednesday, January 29, 2020 7:39 PM
To: Discussion list for LON-CAPA users <lon-capa-users at mail.lon-capa.org>
Subject: Re: [LON-CAPA-users] Hyperbolic Trig Function Problem

Have you considered tried calling on tanh(x) in Maxima using &cas('maxima',   ) instead of using &tanh(x)?



Justin Gray
Senior Lecturer | Department of Mathematics
Simon Fraser University | SCK 10531
8888 University Dr., Burnaby, B.C. V5A 1S6
T: 778.782.4237

Simon Fraser University is located on the Unceded Coast Salish Territories of the xʷməθkʷəy̓əm (Musqueam), Səl̓ílwətaʔ/Selilwitulh (Tsleil-Waututh), Kwikwitlem, and Skwxwú7mesh Úxwumixw (Squamish) Peoples

On Wed, Jan 29, 2020 at 3:43 PM Harding, Gene L <glhardin at purdue.edu<mailto:glhardin at purdue.edu>> wrote:

Does anyone have experience using the hyperbolic trig functions in LON-CAPA? I have recently been coding some new problems that use the &tanh() function. I was comparing the results to those I got using MATLAB, and after some troubleshooting it appears that the difference is the tanh. Specifically, the &tanh($x) function in LON-CAPA always returns an imaginary value of zero.

Here is the code:
$tanh               = &tanh($gamma*$len);
$tanh_real      = Re($tanh);
$tanh_imag    = Im($tanh);
where $gamma is a complex number and $len is a scalar. MATLAB computes a complex number for tanh in the examples I have tried. Am I doing something wrong? Does LC not compute tanh correctly?

Best regards,

Gene L. Harding, PE
Associate Professor of ECET
Purdue University

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20200130/2c19ae5e/attachment-0001.html>

More information about the LON-CAPA-users mailing list