'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)

 Respuesta aceptada

Walter Roberson
Walter Roberson el 19 de Jun. de 2021
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 comentarios

Jaquen Allen
Jaquen Allen el 19 de Jun. de 2021
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.

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2020a

Preguntada:

el 18 de Jun. de 2021

Comentada:

el 19 de Jun. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by