The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 User defined NLF complex function using cosh()

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
jp.medina11 Posted - 09/07/2024 : 7:21:57 PM
Hi,

I am trying to compile a user defined complex function using cosh() in the code builder tab at the NLF fitting Fuction Organizer of OriginPro 2022b. However, I get the error message "Error, cannot convert argument(1) in function call". For some reason when I use the function cos(), it compiles all. But I need the hyperbolic instead. Moreover, if I try to use the function ImCosh(), it is not recognized and the displayed error message is: "Error, function or variable ImCosh not found". The code is here below, if someone can help me I am very grateful!

-------------------------------------------------

void _nlsfIMPS_Complex(
// Fit Parameter(s):
double tau, double alpha,
// Independent Variable(s):
double omega,
// Dependent Variable(s):
double& y1, double& y2)

complex cc = cosh(1+1i*tau*alpha*omega);
y1 = cc.m_re;
y2 = cc.m_im;

-------------------------------------------------

Thanks!!

Juan Medina
1   L A T E S T    R E P L I E S    (Newest First)
YimingChen Posted - 09/09/2024 : 09:04:37 AM
The cosh() function does not accept the complex number as the argument.
https://www.originlab.com/doc/OriginC/ref/cosh

The workaround is to use cos() function since cosh(x) = cos(ix).


complex cc = cos(1i*(1+1i*tau*alpha*omega));
y1 = cc.m_re;
y2 = cc.m_im;


James

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000