Estimate and optimize the parameters in EOMs

2 次查看(过去 30 天)
Dear Sir or Madam,
I hope you are all doing well. I am trying to estimate and optimize the parameters with the numerical data (Displacement, Velocity, Acceleration) in my equations (Matrixes). And there are totally 7 parameters needed to estimate.
I have the structure's motion responses from the software (could be assumed as experimental data). I would like to use these data to estimate and optimize some parameters in the equations as some parameters are nonliner and hard to express mathematically.
I was refering to the 'Non-linear data fit' of help center. However, I have no idea about how to apply the optimization approach to my case. From my perspectives, I need to transfer my equations of motion to first-order system. I assume the external function is 0 (free-decay test). Therefore, the cost function should be 'MyFunction' - 0 = 0. My function could be seen as follows:
I would much appreciate your support.
Thank you.
Best wishes,
Yu Gao
% X1 = Surge; X2 = PlatformPitch; X3 = RelativeAngularDiplacement; X4=Heave
% X5 = SurgeVelocity; X6 = PlatformPitchVelocity;
% X7 = RelativeAugularVelocity; X8 = HeaveVelocity
function yu_gao
function kineticsmodel(un,t)
X0 = [0;10;10;0;0;0;0;0]; % [x10;x20;x30;x40; dx1dt0;dx2dt0;dx3dt0;dx4dt0]
[t, Xv] = ode45(@odefn,t,X0);
function dxdt = odefn(t,X)
x = X(1:4);
xdot = X(5:8);
M = [m mt*ht Iac 0;...
mt*ht It 0 0;...
Iac 0 Ip+mp*hp^2 0;...
0 0 0 m];
A = [ma 0 -mp*hp 0;...
0 mt*ht^2 0 0;...
-mp*hp 0 Ia 0;...
0 0 0 mh];
C = [un(4) 0 un(7) 0;...
0 un(5) -un(5) 0;...
un(7) -un(5) un(5)+un(6) 0;...
0 0 0 ch];
K = [un(1) 0 -un(1)*z 0;...
0 un(2)-mt*ht -un(2) 0;...
-un(1)*z -un(2) un(3)+un(1)*z^2+un(2)+mp*g*hp 0;...
0 0 0 kh];
xddot = (M+A)\(-K*x-C*xdot);
dXdt = [xdot xddot];
end
X=Xv;
end
tspan = 0:0.1:600;
X0 = [0;10;10;0;0;0;0;0];
X = [Surge PlatfromPitch VarName17 Heave SurgeVelocity PlatformPitchsVelocity VarName11 HeaveVelocity];
% X1 = Surge; X2 = PlatformPitch; X3 = RelativeAngularDiplacement; X4=Heave
% X5 = SurgeVelocity; X6 = PlatformPitchVelocity;
% X7 = RelativeAugularVelocity; X8 = HeaveVelocity
z = 14;
ht = 56.50;
hp = 14.94;
height_t = 129.13;
g = 9.81;
m = 20093000; % total mass
mp = 17839000; % platform mass
It = 6.561*10^9;
Ip = 1.251*10^10;
mt = 2254000; % tower+RNA mass
ma = 9.64*10^6; % Added mass for platform surge
mh = 2.480*10^7; % Added mass for platform heave
Ia = 1.16*10^10; % Added mass for platform pitch
Iac = -1.01*10^8;
ch = 1.3*10^5;
kh = 4.470*10^6;
% initial value of the unknown parameters.
un0 = [7.964*10^3 1.5944*10^10 4.453*10^6 9.225*10^5 6.9515*10^7 1.676*10^9 -8.918*10^6];
[un,Rsdnrm,Rsd,ExFlg,OptmInfo,Lmda,Jmat]=lsqcurvefit(@kineticsmodel,un0,t,X);
fprintf(1,'\tRate Constants:\n')
for k1 = 1:length(theta)
fprintf(1, '\t\tTheta(%d) = %8.5f\n', k1, un(k1))
end
tv = linspace(min(tspan), max(tspan));
unfit = kineticsmodel(un, tv);
figure(1)
plot(t, c, 'p')
hold on
hlp = plot(tv, unfit);
hold off
grid
xlabel('Time')
ylabel('Concentration')
legend(hlp, 'un_1(t)', 'un_2(t)', 'un_3(t)', 'un_4(t)', 'un_5(t)','un_6(t)','un_7(t)','Location','N')
end
  8 个评论
Sam Chak
Sam Chak 2024-3-13
Also, instead of labeling technical names in the Excel, try labeling them to indicate which column data corresponds to X1, X2, X3, and so on up to X8.
By the way, it seems that the x-axis data {-75 to 600} is not aligned with the rest of the columns, likely due to a hasty copy-paste. It is uncommon for software-generated data to have this kind of mistake.
Yu
Yu 2024-3-13
编辑:Yu 2024-3-13
Hi @Sam Chak Thank you for your suggestions. I have added some comments in the codes. Please see the updated codes at the top.
Yes, there are 7 unknown parameters (possible more). And I want to find the parameters to satisfy my equations by using numerical or experimental results.
The vector X should comprise velocity, and displacment. I am not sure whether I should use acceleration as it is the second-order differential. As you can see in my kinetic model. They are multipled by mass, damping, and stiffness respectively. Yes, I would use these parameters from experiment or numerical simulation to find the optimal parameters. To be honest, it should be basic step. This is the 'offline' method (I was told). Because I know the variables' values. I can introduce these values into the matrices (Md/dt(dx/dt)+C(dx/dt)+Kx=0). Let F=Md/dt(dx/dt)+C(dx/dt)+Kx. So the finally target is find the 7 unknow parameters to let F=0.
Thank you for your sugestions. The minus time is becasue it is static analysis which is distinguished by it. I have modified it. Please refer the file attached.
Best wishes,
Yu

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by