<div dir="ltr">Have you considered tried calling on tanh(x) in Maxima using &cas('maxima',   ) instead of using &tanh(x)?<div><br></div><div>Justin</div><div><div><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="border:0px;margin:0px;padding:0px"><div style="border:0px;margin:0px;padding:0px"><h3 style="border:0px;margin:1.5rem 0px;padding:0px"><div style="color:rgb(0,0,0);font-family:"Source Serif Pro",sans-serif;font-size:16px;border:0px;margin:0px;padding:0px"><div style="border:0px;margin:0px;padding:0px"><p style="border:0px;margin:1rem 0px 1.5rem;padding:0px;font-stretch:normal;font-size:12px;line-height:18px;font-family:Arial,Helvetica,sans-serif"><span style="font-weight:normal">--</span></p><p style="font-weight:100;border:0px;margin:1rem 0px 1.5rem;padding:0px;font-stretch:normal;font-size:12px;line-height:18px;font-family:Arial,Helvetica,sans-serif"><b>Justin Gray</b><br>Senior Lecturer | Department of Mathematics<br>Simon Fraser University | SCK 10531<br>8888 University Dr., Burnaby, B.C. V5A 1S6<br>T: 778.782.4237</p></div></div><span style="font-weight:normal"><font size="1">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</font></span></h3></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 29, 2020 at 3:43 PM Harding, Gene L <<a href="mailto:glhardin@purdue.edu" target="_blank">glhardin@purdue.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US">
<div>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">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
<u>always</u> returns an imaginary value of zero.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">Here is the code: <u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.5in"><span style="color:rgb(31,73,125)">$tanh               = &tanh($gamma*$len);<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.5in"><span style="color:rgb(31,73,125)">$tanh_real      = Re($tanh);<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.5in"><span style="color:rgb(31,73,125)">$tanh_imag    = Im($tanh);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">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?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">Best regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">Gene L. Harding, PE<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">Associate Professor of ECET<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">Purdue University<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">574-520-4190</span><u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

</blockquote></div>