how to retrieve 3 parameters by fitting data into a model
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
I have a data set of surface impedance of a material. I need to retrieve 3 parameters from a model by fitting this data into it. I have no previous experience in Matlab. can i get any suggestions and explanations on how to go about it?
採用された回答
Ameer Hamza
2020 年 4 月 27 日
See fit(): https://www.mathworks.com/help/releases/R2020a/curvefit/fit.html from curve fitting toolbox and https://www.mathworks.com/help/releases/R2020a/optim/ug/lsqcurvefit.html from optimization toolbox. For a specific suggestion, share the equation of your mathematical model.
11 件のコメント
please look at this equation sheet.
Ameer Hamza
2020 年 4 月 29 日
These equations look quite complicated. You need to write these in MATLAB format before trying to estimate the parameters.
x = 0.001; %porosity
s = 001; % mean pore size
y = 0.001;% standard deviation
w = 127; % frequency (input from data sheet)
theta1 = (1/3);
theta2 = exp((-1/2)*((y*log2)^2))/sqrt(2); %theta values
theta3 = theta1/theta2;
rhozero = 1.225; %ambient density of air
alpha = exp(4*(y*log2)^2); %tortosity
eta = 1.81e-5; %dynamic viscosity of air
sigma = (((8*eta*alpha)/((s^2)*x)))* (exp(6*(y*log2)^2)); %bulk flow resistivity
epsilonp = sqrt((-(w*rhozero*alpha)i)/(x*sigma));
fp = (1+ (theta3*epsilonp)+(theta1*epsilonp))/(1+(theta3*epsilonp));
%substituting to main equation part 1
pw = ((rhozero*alpha)/(x))*((1+(epsilonp)^-2)*fp); %p omega
gamma = 1.4; %specific heat ratio
thetab = exp((3/2)*((y*log2)^2));
thetac = theta1/thetab;
sigma1 = (((8*eta*alpha)/((s^2)*x)))* (exp(-6*(y*log2)^2));
npr = 0.71; %prandtl number of air
epsilonc = sqrt((-(w*rhozero*npr*alpha)i)/(x*sigma1));
fc = (1+(thetac*epsilonc)+(theta1*epsilonc))/(1+(thetac*epsilonc));
po = 1.013e5; %ambient atmospheric pressure
cw = (x/(gamma*po))*(gamma-((gamma-1)/(1+((epsilonc)^-2)*fc); %c omega
%equations
zb = sqrt(pw/cw);
kb = (w* sqrt(pw*cw));
h = 50; % thickness of sample
czero = 343; %speed of sound m/s
%main equation
z = (zb * coth((-(kb*h)i)/(rhozero * czero)));
x0 = [x,s,y];
m = fminsearch(z,x0);
i want to use fminsearch on function z to retrieve the paramters porosity, mean pore size and standard deviation. i have given them initial values. could you check if the syntax for fminsearch is correct?
Ameer Hamza
2020 年 5 月 10 日
You need to write an objective function to use fminsearch. What is your equation?
z = (zb * coth((-(kb*h)i)/(rhozero * czero)))
this is my equation.
Ameer Hamza
2020 年 5 月 10 日
You need to write a separate function that takes the value of x, s, and y as input and output the value of z. Just take your code and encapsulate it into a function.
so i need to expand this equation just in terms of x,s and y as input? just defining them like i did at the start of the coding won't work?
Ameer Hamza
2020 年 5 月 10 日
No. You need to write a separate function. fminsearch needs a function handle. You just need to write the function in which value of x, s and y are not pre-defined. The function takes these values as input and returns the value of 'z'.
i have a set of data for z which i got from experimients. i need a tool that will run these equations and iterate values for x,s and y until i get the closest value of z. is this possible using fminsearch?
ie the tool should give me the closest theoretical z to experimental z and the respectives values of x,s and y at that point.
In that case, you will need to use lsqcurvefit() instead of fminsearch. In any case, you need to write it into a function of the variables you are trying to estimate. Something like this
function z = myModel(z,s,z)
% you code to calculate z
z = .. % value of z
end
okay thank you very much. i will try it out and get back to you
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Optimization Toolbox についてさらに検索
製品
タグ
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
