How can I solve this?
Mostrar comentarios más antiguos
clc
clear
syms PL c k
eqn = [PL * exp(-c*exp(-k*0)) == 179323 ; PL * exp(-c*exp(-k*10)) == 203302 ; PL * exp(-c*exp(-k*20)) == 226542]
S = solve(eqn , [PL;c;k] )
S =
struct with fields:
PL: [0×1 sym]
c: [0×1 sym]
k: [0×1 sym]
2 comentarios
Muhammad Usman
el 23 de Oct. de 2022
the set of equations are non linear in nature that's why you can't use solve to compute the solution
Walter Roberson
el 23 de Oct. de 2022
The equations have no solution over reals.
Respuestas (2)
% Solve the system of equations starting at the point [0,0,0].
% PL = x(1); c = x(2); k = x(3);
% Initial guess is [0,0,0], you can change it accordingily
fun = @root2d;
x0 = [0,0,0];
x = fsolve(fun,x0)
function F = root2d(x)
F(1) = x(1) * exp(-x(2)*exp(-x(3)*0)) - 179323;
F(2) = x(1) * exp(-x(2)*exp(-x(3)*10)) - 203302;
F(2) = x(1) * exp(-x(2)*exp(-x(3)*20)) - 226542;
end
2 comentarios
CHENG WEI LI
el 23 de Oct. de 2022
Alex Sha
el 24 de Oct. de 2022
There are actually numerical solutions like below:
x1: 446505.431672107
x2: 0.912262916225993
x3: 0.0148006249649759
syms PL c k
eqn1 = PL * exp(-c*exp(-k*0)) == 179323;
eqn2 = PL * exp(-c*exp(-k*10)) == 203302;
eqn3 = PL * exp(-c*exp(-k*20)) == 226542;
sPL = solve([eqn1 eqn2],[c,k]);
PLsol = solve(subs(eqn3,[c,k],[sPL.c sPL.k]),PL);
sck = solve([subs(eqn1,PL,PLsol),subs(eqn2,PL,PLsol)],[c,k]);
csol = sck.c;
ksol = sck.k;
vpa(PLsol)
vpa(csol)
vpa(ksol)
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!