Filter löschen
Filter löschen

Fraser Suzuki Function written in MATLAB

17 Ansichten (letzte 30 Tage)
Christian Reece
Christian Reece am 15 Mai 2015
Kommentiert: Junmeng Cai am 12 Apr. 2021
I am trying to write a piece of code which will simulate a Fraser Suzuki function, which is an asymmetrically skewed Gaussian. There are a multitude of papers citing the equation, but I cannot seem to get it working in MATLAB.
I've attached an image of the function above. In the paper they also perform a parameter test on the function to make sure they get the desired peak shape. An example I've attached below.
When I write this function myself the
T-p/w
section of the code goes negative, causing the log function to give imaginary values. As this function has been cited multiple times in literature it seems that it's not the function itself that's wrong but my interpenetration in the code. I've attached the code I've been using the simulate the function.
%%FSuzuki
T = linspace(450,700,1000);
h = 0.005;
p = 600;
w = 40;
s = -0.3;
arg1 = log(2*s*T-p/w+1).^2;
y = h*exp(-log(2)/(s^2)*arg1);
Any help would be greatly appreciated.
  1 Kommentar
Joseph Cheng
Joseph Cheng am 15 Mai 2015
well first of all your matrix operation for arg1 is off. it should be 2*s*(T-p)/w+1. which doesn't solve the issue but should be corrected.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Joseph Cheng
Joseph Cheng am 15 Mai 2015
Alright, found the paper you mentioned and plotted it in different programs. So... What is happening is that the authors of the paper are ignoring the complex solutions for their Fraser Susuki equation. such that if i re-write your code to be
T = linspace(450,700,1000);
h = [0.005 0.0075 0.01 0.0125 0.015]';
figure(1),hold on
for ind = 1:numel(h)
p = 600;
w = 40;
s = -.3;
lntpw = log(1+2*s*(T-p)/w).^2;
FS = h(ind)*exp(-log(2)/s^2*lntpw);
FS(FS~=real(FS))=0;
plot(T,FS)
end
you get the same curves that they have in the paper.
  9 Kommentare
Chuan Ma
Chuan Ma am 6 Okt. 2020
Hello,
Racio,
Can you tell me how to avoid the complex numbers?
Thank you.
Chuan
Junmeng Cai
Junmeng Cai am 12 Apr. 2021
Dear Joseph Cheng, thank you very much!
Great!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by