Help to find the equation of a decreasing exponential function
    4 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
I am interested in finding an equation that allows me to describe a decreasing exponential function.
I want to find an equation that allows me the value of y2 to adapt to the values measured for y

x=[20 150 350 1850 3000 7000 13500 21600 28800 63500 70000 140000 250000 338000 445000 589000];
y=[46.0594 44.6380 44.0190 42.6834 42.25 41.4194 40.7 40.1367 39.769 38.6562 38.5076 37.3686 36.2925 35.6830 35.0948 34.4616]
y2=y
plot(x,y,x,y2)
grid on
I think it could be a logarithmic function.
0 comentarios
Respuestas (1)
  Star Strider
      
      
 el 1 de Mzo. de 2018
        Two possibilities:
x=[20 150 350 1850 3000 7000 13500 21600 28800 63500 70000 140000 250000 338000 445000 589000];
y=[46.0594 44.6380 44.0190 42.6834 42.25 41.4194 40.7 40.1367 39.769 38.6562 38.5076 37.3686 36.2925 35.6830 35.0948 34.4616];
xv = linspace(min(x), max(x), 50);
pwrfcn = @(b,x) b(1).*x.^b(2) + b(3);
expfcn = @(b,x) b(1).*exp(b(2).*x) + b(3);
[Bp,pnres] = fminsearch(@(b) norm(y - pwrfcn(b,x)), [10; -1; 30]);
[Be,enres] = fminsearch(@(b) norm(y - expfcn(b,x)), [10; -1E-2; 30]);
figure
plot(x, y, 'pg', 'MarkerFaceColor','g')
hold on
plot(xv, pwrfcn(Bp,xv), '-r')
plot(xv, expfcn(Be,xv), '-b')
hold off
grid
legend('Data','Power Function (P)','Exponential Function (E)')
text(1.5E+5, 43, sprintf('P(x) = %.1f\\cdotx^{%.1E\\cdotx}%+.1f, Resid Norm = %.2f',Bp,pnres))
text(1.5E+5, 41, sprintf('E(x) = %.1f\\cdote^{%.1E\\cdotx}%+.1f, Resid Norm = %.2f',Be,enres))
The power function has the lowest norm of residuals.
There may be other functions, especially if we know the process that created your data. Estimating the parameters of the mathematical model of that process would be the most accurate.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

