Minimize the sum of squared errors between the experimental and predicted data in order to calculate two parameters
41 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
ORESTE SAINT-JEAN
el 28 de Mzo. de 2023
Comentada: Mathieu NOE
el 29 de Mzo. de 2023
In my research work, I use a model and I want to minimize the sum of squared errors between the experimental and predicted data in order to calculate two parameters.
The experimental data are:
u exp: [0.709; 0.773 ;0.823 ;0.849 ;0.884 ;0.927 ;0.981 ;1.026 ;1.054 ;1.053 ;1.048;1.039] ;
observed at z=[ 0.006;0.012;0.018;0.024;0.03;0.046;0.069;0.091;0.122;0.137;0.152;0.162];
The equation of the model that I use is:
u model=0.1073*((log(0.13/z)-1/3*(1-(z/0.13)^3)+2*a*(1+(b)^0.5)*cos(11.89*z)); and I want to calculate the parameters “a” et “b” by minimizing the sum of squared errors between “u exp” and “u model”.
Someone here can help me please?
Thank you already for your help!
0 comentarios
Respuesta aceptada
Davide Masiello
el 29 de Mzo. de 2023
Editada: Torsten
el 29 de Mzo. de 2023
You can use MatLab's fmincon.
z = [0.006;0.012;0.018;0.024;0.03;0.046;0.069;0.091;0.122;0.137;0.152;0.162];
u_exp = [0.709;0.773;0.823;0.849;0.884;0.927;0.981;1.026;1.054;1.053;1.048;1.039];
u_mod = @(P) 0.1073*(log(0.13./z)-1/3*(1-(z/0.13).^3)+2*P(1).*(1+P(2).^0.5).*cos(11.89*z));
sum_sq_err = @(P) sum((u_exp-u_mod(P)).^2);
P = fmincon(sum_sq_err,[0.1,0.1]);
a = P(1)
b = P(2)
hold on
plot(z,u_exp,'o')
plot(z,u_mod(P))
hold off
grid on
4 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Statistics and Machine Learning Toolbox 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!