I want to fit the model containing double numerical integral with data

조회 수: 2 (최근 30일)
RAHUL KUMAR
RAHUL KUMAR 2023년 2월 20일
답변: Sandeep 2023년 3월 30일
I have attached the data. I want to fit the data with the model which is very complicated which contains double numerical integration and has parameters 'par'. I have the only choice of fitnlm as per my knowledge. But I think it might take much time to fit. If you could recommend other algorithm which do not require derivative during iteration such as differential evolutution or any other, pls tell me how to implement.
clc;
clear all;
load('Figure9S11.mat');
load('Figure9S22.mat');
xdata11 = Figure9S11(1:225,1);
ydata11 = Figure9S11(1:225,2);
beta0=[2;1;0.1;212.8];
% Fit the model to the data
mdl = fitnlm(xdata11, ydata11, @BiaxialNewInvariant11, beta0);
disp(mdl)
function K1 = BiaxialNewInvariant11(par,lambda1)
hmod33minushmod11 = @(theta,phi,lambda1) (1/2).*lambda1.^2.*cos(phi).^2.*sin(theta).^2.*(1+((-1)+ ...
lambda1.^2).*(lambda1.^(-8).*((-1)+lambda1.^2).^2.*((1+ ...
lambda1.^2).^2.*cos(theta).^2+lambda1.^8.*sin(theta).^2)).^( ...
-1/2))+(-1/2).*lambda1.^(-4).*cos(theta).^2.*(1+lambda1.^( ...
-4).*(1+(-1).*lambda1.^4).*(lambda1.^(-8).*((-1)+lambda1.^2) ...
.^2.*((1+lambda1.^2).^2.*cos(theta).^2+lambda1.^8.*sin( ...
theta).^2)).^(-1/2));
Imat = @(theta,lambda1) (1/4).*lambda1.^(-4).*(1+(-2).*lambda1.^4+lambda1.^6+(-1).*( ...
(-1)+lambda1.^6).*cos(2.*theta)+lambda1.^4.*(lambda1.^(-8).* ...
(2.*((-1)+lambda1.^2).^2.*(1+2.*lambda1.^2+lambda1.^4+ ...
lambda1.^8)+(-2).*((-1)+2.*lambda1.^4+(-2).*lambda1.^10+ ...
lambda1.^12).*cos(2.*theta))).^(1/2));
rho = @(theta,phi,par) 2.*2.^(1/2).*exp(1).^(2.*par(4).*cos(phi).^2.*sin(theta).^2).*( ...
par(4).*pi.^(-1)).^(1/2).*erfi(2.^(1/2).*par(4).^(1/2)).^(-1);
Dw = @(theta,lambda1,par) (3/2).*par(2).*exp(1).^(par(3).*Imat(theta,lambda1).^3).*Imat(theta,lambda1).^4;
integrand = @(par,lambda1,theta,phi) 2*par(1)*Dw(theta,lambda1,par).*(sin(theta)).*rho(theta,phi,par).*Dw(theta,lambda1,par).* ...
hmod33minushmod11(theta,phi,lambda1);
K1 = 0.3E0.*((-1).*lambda1.^(-4)+lambda1.^2)+ integral2(@(phi,theta) integrand(par,lambda1,theta,phi),0,2*pi,0,pi);
end

답변 (1개)

Sandeep
Sandeep 2023년 3월 30일
Hi RAHUL KUMAR,
It is suggested to use a genetic algorithm or a particle swarm optimization algorithm, if you want to use an optimization algorithm that does not require the calculation of derivatives during the iteration.
The reason to use these algorithms is that they do not require derivative information during the optimization process. They search for the optimal solution by iteratively exploring the parameter space, evaluating the objective function at each point and updating the current best solution.

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by