'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

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!
.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 Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2021년 6월 18일

댓글:

2021년 6월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by