lanhep can not compile sqrt function somewhere

Asked by MohammadMohammadidoust

Hello!
when I decide to add a new model in lanhep. sqrt function sometimes works but sometimes in the same code it doesn't work and bad expression error happens.
for example please look at these two lines in a same code , in the first line there is no problem but in the second one lanhep can not compile it.

parameter MSi=2*muqs+((2*MW/EE*SW)**2*sqrt(2)*alfa/2).

lterm -(alfa)*PP*pp*('~S')**2/(sqrt(2)).

if it's possible please help me what to do

Question information

Language:
English Edit question
Status:
Solved
For:
CalcHEP Edit question
Assignee:
No assignee Edit question
Solved by:
Alexander Pukhov
Solved:
Last query:
Last reply:
Revision history for this message
Alexander Pukhov (pukhov) said :
#1

You can use Sqrt2. Lanhep has to understand it and take into account
Sqrt2^2=2.

About sqrt(2). Try to declare

     external_func(sqrt,1).

Here the last argument is the number of parameters. In general, if you
are going  to use some external function, you have to declare it first.

Best

    Alexander Pukhov

On 12/12/20 2:20 PM, MohammadMohammadidoust wrote:
> New question #694480 on CalcHEP:
> https://answers.launchpad.net/calchep/+question/694480
>
> Hello!
> when I decide to add a new model in lanhep. sqrt function sometimes works but sometimes in the same code it doesn't work and bad expression error happens.
> for example please look at these two lines in a same code , in the first line there is no problem but in the second one lanhep can not compile it.
>
> parameter MSi=2*muqs+((2*MW/EE*SW)**2*sqrt(2)*alfa/2).
>
> lterm -(alfa)*PP*pp*('~S')**2/(sqrt(2)).
>
>
> if it's possible please help me what to do
>

Revision history for this message
MohammadMohammadidoust (m23mohamadidoust) said :
#2

Thanks for your answer but the problem still exists . However I added the external_func(sqrt,1).
On the other hand if I use sqrt2 the Error will change to undefined object 'sqrt2' .

can I send you the .mdl file?

sincerely

Revision history for this message
Best Alexander Pukhov (pukhov) said :
#3

*S*qrt2

Best

    Alexander Pukhov

On 12/12/20 6:25 PM, MohammadMohammadidoust wrote:
> Question #694480 on CalcHEP changed:
> https://answers.launchpad.net/calchep/+question/694480
>
> Status: Answered => Open
>
> MohammadMohammadidoust is still having a problem:
> Thanks for your answer but the problem still exists . However I added the external_func(sqrt,1).
> On the other hand if I use sqrt2 the Error will change to undefined object 'sqrt2' .
>
> can I send you the .mdl file?
>
> sincerely
>

Revision history for this message
MohammadMohammadidoust (m23mohamadidoust) said :
#4

Thanks Alexander Pukhov, that solved my question.