fityk icon indicating copy to clipboard operation
fityk copied to clipboard

How to define Fraser-Suzuki function

Open xpfy opened this issue 8 months ago • 2 comments

I have defined a funtion named Fraser-Suzuki, like this: FS(height, center, hwhm, shape) = heightexp(-ln(2)(ln(1+2shape(x-center)/hwhm)/shape)^2), but when x<center, then the ln() function is not defined in this region. How can I solve this problem? Thank you.

xpfy avatar Oct 25 '23 14:10 xpfy

Maybe this question is more suitable for the mailinglist but try something like this? FS(height, center, hwhm, shape) = x > center - (hwhm)/(2shape)? heightexp(-ln(2)(ln(1+2shape(x-center)/hwhm)/shape)^2) : 0

You must also make sure shape is not 0, so it's either a three-way split or limit the domain of shape.

henkmet avatar Oct 26 '23 04:10 henkmet

I am very happy to receive your reply. Actually , I have tried this method, but ternary(? :)can not support the constant 0, so I tried to use the in-built function Constant, and 0 was recognized as Constant(0), but the result did not look right. Can you give me some suggestions?

Thank you.

从 Windows 版邮件发送

发件人: henkmet 发送时间: 2023年10月26日 12:51 收件人: wojdyr/fityk 抄送: xpfy; Author 主题: Re: [wojdyr/fityk] How to define Fraser-Suzuki function (Issue #59)

Maybe this question is more suitable for the mailinglist but try something like this? FS(height, center, hwhm, shape) = x > center - (hwhm)/(2shape)? heightexp(-ln(2)(ln(1+2shape(x-center)/hwhm)/shape)^2) : 0 You must also make sure shape is not 0, so it's either a three-way split or limit the domain of shape. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

xpfy avatar Oct 26 '23 05:10 xpfy