How to solve for gamma
2 ビュー (過去 30 日間)
古いコメントを表示
Hello, I'm trying to solve for gamma in this equation, I was hoping if someone can help out.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1217147/image.jpeg)
considering everything else is a constant that can be put as an input.
2 件のコメント
Torsten
2022 年 12 月 2 日
An analytical expression for gamma does not seem possible.
Use "fzero" or "fsolve" as numerical root finders for
left-hand side(gamma) - right-hand side(gamma) = 0
採用された回答
Torsten
2022 年 12 月 2 日
編集済み: Torsten
2022 年 12 月 2 日
format long
dbs=5.3e-10;
das=1.01e-9;
cb=4e3;
ca=1e3;
x0 =0;
options = optimset('TolX',1e-14,'TolFun',1e-14);
x = fsolve(@(x)myfun(x,dbs,das,cb,ca),x0,options)
myfun(x,dbs,das,cb,ca)
function F = myfun(x,dbs,das,cb,ca)
F = (1-erf(sqrt(x/dbs)))-(((cb/ca)*sqrt(dbs/das))*(erf(sqrt(x/das)))*(exp((x/das)-(x/dbs))));
end
5 件のコメント
Torsten
2022 年 12 月 5 日
編集済み: Torsten
2022 年 12 月 5 日
Seems your equation has multiple solutions.
A good idea is always to plot the function to have a good guess for the solution.
dbs=5.3e-10;
das=1.01e-9;
cb=4e3;
ca=1e3;
F = @(x)(1-erf(sqrt(x/dbs)))-(((cb/ca)*sqrt(dbs/das))*(erf(sqrt(x/das))).*(exp((x/das)-(x/dbs))));
x = 0:1e-12:2e-10;
plot(x,F(x))
sol = fzero(F,[0 1e-9])
F(sol)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Gamma Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!