Fit experimental data to analytical expression
Show older comments
Hi,
I'm struggling to fit an experimentally measured variable to an analytical expression. The experimentally measured variable is called the phase velocity (Eq 2; screenshot attached) and I am aiming to fit it within an analytical expression (Eq 3; also attached as a screenshot) to determine mu and eta, which are the shear modulus and shear viscosity of a sample. Now the paper I am using as reference describes doing the following: "The final phase velocity curve was then fitted by the linear least squares method to (2) and (3) to obtain the shear viscoelasticity of the tissues. The shear elasticity and shear viscosity were varied in the model y(mu, eta) with step size of 0.1 kPa and 0.1 Pa · s until the error between the model and the phase velocity data was minimized". I am struggling to implement this in MATLAB. My questions are the following:
1/ What is the best way to fit the experimentally measured phase velocity to Eq 3? Is it with symbolic variables or fminsearch or neither? How do I even write out equation 3 given that it is a two-sided equation and phase velocity is a function of variables on both sides? I have tried the following based on what I've read online (but I am sure it is incorrect):
k_L = omega ./ phase_vel;
numPar = 2;
mu = sym('mu', [1 numPar]);
thickness = 4e-3;
ks = omega .* sqrt(rho ./ (mu));
kl = omega ./ phase_vel;
h = thickness / 2;
beta = sqrt (kl.^2 - ks.^2);
first_term = 4 .* kl.^3 .* beta .* cosh ( kl .* h) .* sinh ( beta .* h);
second_term = ( ks.^2 - 2 .* ( kl.^2 )).^2 .* sinh ( kl .* h ).* cosh( beta .* h );
third_term = ks .^ 4 .* cosh ( kl .* h) .* cosh ( beta .* h);
fun1 = symfun(first_term - second_term - third_term, mu);
myfun = matlabFunction(fun1, 'Vars', {mu});
mu = [10e3, i .* omega .* 0.01];
[x, fval, exitflag, output] = fminsearch (mufun, mu);
Here, phase_vel would be the experimentally measured values.
2/ How would I determine the mu and eta from this using LLS to obtain the values? Is there a way to integrate it from above?
Thank you in advance for your time and help! Any code that would help me address 1/ and 2/ would be very appreciated. Have a great day! :)
3 Comments
Cris LaPierre
on 22 Nov 2023
Torsten
on 22 Nov 2023
You say you measured the phase velocity - so phase velocity seems to be the dependent variable in your model. What is the independent variable - thus which parameter was varied to get different phase velocities ? Is it omega ?
Joseph
on 22 Nov 2023
Accepted Answer
More Answers (0)
Categories
Find more on Support Vector Machine Regression in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
