What is the best function of the following shape?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
M
el 6 de Sept. de 2022
Editada: Bruno Luong
el 12 de Sept. de 2022
How can I construct this shape? what is the best function of it?
It is more like sigmoid function + straight line
But I cant get how can I represent it by one equation and How to control its limits!
The Y limits should be from 0 to 1
( I want to use it as a fuzzy memebership function)
Is there any recommendation?
2 comentarios
Sam Chak
el 7 de Sept. de 2022
Not exactly sure what you want to do because you didn't define the problem in a mathematical manner. The existing functions in the Fuzzy Toolbox library stock do not have cutoff points. Guess you want to create a custom Sigmoidal Membership Function with one-sided cutoff point for your unique Fuzzy System, where it can be rescaled and reflected in anyway you want:
Respuesta aceptada
Sam Chak
el 7 de Sept. de 2022
Editada: Sam Chak
el 12 de Sept. de 2022
Hi @M
The original code was accidentally highlighted and deleted due to sensitive touchpad. It was constructed based on @Torsten's idea on the Arctangent function but I replaced it with the Logistic function as shown in this link:
Since you don't want anything to do with the Fuzzy Logic Toolbox, this new solution, a Quintic function (not in the toolbox, so you can probably claim novelty in the Fuzzy MF paper), is tailor-made for you so that you adjust the position of the cutoff point (end point of blue line) easily.
Example #1: The Quintic function, a 5th-order polynomial, is commonly used in the trajectory planning of a mobile robot. So I modified the function for a custom fuzzy membership function.
I have not tested everything. But this is the basic concept for you to develop. Hope it helps.
% Quintic function-based MF (blue line as main)
% Start point (xA, yA); End point (xB, yB);
xf = 1;
x = linspace(0, xf, xf*1e4 + 1);
yA = 0;
yB = 1;
xA = 0.1;
xB = 0.9;
y = (yA + (10*((x - xA)/(xB - xA)).^3 - 15*((x - xA)/(xB - xA)).^4 + 6*((x - xA)/(xB - xA)).^5)*(yB - yA)).*((0 <= (x - xA)) & ((x - xA) < (xB - xA)));
plot(x, y, -(x-xf), y), grid on, ylim([0 1.2])
legend('MF_1', 'MF_2', 'location', 'north')
xlabel('Universe of Discourse, \it{x}'), ylabel('\mu(\it{x})')
xf = 1;
x = linspace(0, xf, xf*1e4 + 1);
xA = 0.1; % Left bound of the blue S-curve
xB = 0.9; % Right bound of the blue S-curve
a = 2*9.2; % (logistic growth rate) adjust the steepness of S-curve
c = 0.5; % shift the center of S-curve to x = c
y = sigmf(x, [a c]).*((0 <= (x - xA)) & ((x - xA) < (xB - xA)));
plot(x, y, -(x-xf), y), grid on, ylim([0 1.2])
legend('MF_1', 'MF_2', 'location', 'north')
xlabel('Universe of Discourse, \it{x}'), ylabel('\mu(\it{x})')
7 comentarios
Sam Chak
el 12 de Sept. de 2022
@M, Theoretically, the polynomial function offers more flexibility in adjusting the shape of the S-curve in anyway you like as long as it is monotonically increasing/decreasing, and if you know how to adjust the coefficients of the terms.
For simplicity, you may want to choose the Logistic function (aka sigmf), because you just need adjust one parameter, the logistic growth rate (a) to shape the steepness of the S-curve.
I have added a second example in the edited Answer.
Bruno Luong
el 12 de Sept. de 2022
((0 <= (x - xA)) & ((x - xA) < (xB - xA)))
or equivalently
((x >= xA) & (x < xB))
Más respuestas (4)
Bruno Luong
el 7 de Sept. de 2022
Try this:
xmin = 1;
xmax = 3;
pp = struct('form','pp',...
'breaks',[-1e-100 0 1 inf],...
'coefs',[0 0 0 0 0 0;6,-15,10,0,0,0;0 0 0 0 0 1],...
'pieces',3,...
'order',6,...
'dim',1);
sfun = @(x) ppval(pp,(x-xmin)/(xmax-xmin));
ezplot(sfun,xmin-1,xmax+1)
13 comentarios
Walter Roberson
el 12 de Sept. de 2022
In analysis, a "function" is any mapping of values to other values. It might or might not be "one to one" or "onto". There is no requirement that the function maps all possible inputs in the domain.
In analysis, functions over infinite sets are treated like the limit of finite mappings. For example, x->x^2, x in Z, is treated as-if it were the set of mappings {..., -2 -> 4, -1 -> 1, 0 -> 0, 1 -> 1, 2 -> 2, ...} rather than as being something fundamentally different. There does not have to be a formula for a function: the complete list of mappings defines the function; formulae can make it significantly more compact to express though. The mappings are the fundamental property of the function; formulae are conveniences to express mappings.
Bruno Luong
el 12 de Sept. de 2022
Editada: Bruno Luong
el 12 de Sept. de 2022
"There is no requirement that the function maps all possible inputs in the domain."
Wrong to my book, all elements of input set (domain) must be mapped (defined) by the function.
Walter Roberson
el 6 de Sept. de 2022
Looks like tansig
2 comentarios
Image Analyst
el 12 de Sept. de 2022
James Tursa
el 6 de Sept. de 2022
Editada: James Tursa
el 6 de Sept. de 2022
There are lots of functions that could fit this general shape. E.g., sin(x), or more generally A*sin(B*x+C) depending on width and height of the graph which you don't show. Maybe you could share some more details about where this shape comes from and the height and width sizes.
3 comentarios
Image Analyst
el 12 de Sept. de 2022
@M there are a variety of equations that can do that. See
and just pick one.
Ver también
Categorías
Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!