'solve' not working as expected for Log Equations

Not sure why the first equation (f) cannot find a solution but the second (g) can? They are the same equation just in different forms.
Am I misunderstanding something about how the matlab solver works?
clc; clear
syms n k real
y=[.2;.6]; t=[280; 425];
f1= y(1)==1-exp(-k.*t(1).^n);
f2= y(2)==1-exp(-k.*t(2).^n);
Sol=solve(f1,f2)
g1= log(log(1/(1-y(1))))==n*log(t(1))+log(k);
g2= log(log(1/(1-y(2))))==n*log(t(2))+log(k);
Sol=solve(g1,g2)

 採用された回答

Walter Roberson
Walter Roberson 2021 年 6 月 19 日

1 投票

if you vpasolve() and use a low enough start then it will find a solution
ss=vpasolve([f1,f2],[n,k], [.8999999040792;1])
The start point I show here is about the upper limit; for example .8999999040793 will not work.

2 件のコメント

Jaquen Allen
Jaquen Allen 2021 年 6 月 19 日
So the only way to solve in that form is to have an approx estimate of the values you're looking for? Appreciate the help!
Walter Roberson
Walter Roberson 2021 年 6 月 19 日
.89 is pretty far from the actual value, on a relative scale.
clc; clear
syms n k real
y=[.2;.6]; t=[280; 425];
f1= y(1)==1-exp(-k.*t(1).^n);
f2= y(2)==1-exp(-k.*t(2).^n);
eqn = [f1,f2];
Sol = vpasolve(eqn, [n, k], [50;0]);
[Sol.n, Sol.k], subs(eqn, Sol)
ans = 
ans = 
Sol.n
ans = 
50.0
Sol = vpasolve(eqn, [n, k], [0;0]);
[Sol.n, Sol.k], subs(eqn, Sol)
ans = 
ans = 
It looks like too large of an initial guess leads to false solutions if it gives a solution at all.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSymbolic Math Toolbox についてさらに検索

製品

リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by