How can I solve this equation in which variable is in power

조회 수: 5 (최근 30일)
AJMIT KUMAR
AJMIT KUMAR 2021년 1월 18일
댓글: Star Strider 2021년 1월 19일
I tried this but getting wrong solution
syms a b c d
eqn1 = 2.1544 == a*(5.95^b) + c*(5.95^d);
eqn2 = 1.71 == a*(6.72^b) + c*(6.72^d);
eqn3 = 1.99 == a*(6.35^b) + c*(6.35^d);
eqn4 = 1.59 == a*(6.98^b) + c*(6.98^d);
eqns = [eqn1 eqn2 eqn3 eqn4];
vars = [a b c d];
R = vpasolve(eqns,vars);
  댓글 수: 1
AJMIT KUMAR
AJMIT KUMAR 2021년 1월 18일
I got these values by using vpasolve which is wrong (Put back these value to equation, it will not satisfy)
a = -4.5917748078995605780028770985244e-41;
b = 98.395408219472484524557308589775;
c = 61.139888401602841212761952348352;
d = 23.111701126115183488493226207409;

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2021년 1월 18일
One option is to use GlobalSearch:
y = [2.1544; 1.71; 1.99; 1.59];
rhs = @(a,b,c,d) [a*(5.95.^b) + c.*(5.95.^d); a.*(6.72.^b) + c.*(6.72.^d); a.*(6.35.^b) + c.*(6.35.^d); a.*(6.98.^b) + c.*(6.98.^d)];
gs = GlobalSearch;
fcn = @(b) norm(y - rhs(b(1),b(2),b(3),b(4)));
Problem = createOptimProblem('fmincon', 'x0',randn(4,1), 'objective',fcn)
B = run(gs, Problem)
fval = fcn(B)
producing (with reasonable consistency):
B =
67.619440740979044
-1.924836292732742
81.251260559584935
-43.549761874231805
and:
fval =
0.073738107681070
That is likely as good as it can get, although other values may be possible, with:
B =
46.932805349518709
-15.145390708060569
67.619902371215474
-1.924839968141592
producing approximately the same value for ‘fval’.
Note that this is not a particularly well-posed problem, so the individual parameter values will vary, and there could be a wide range of possible solutions.
  댓글 수: 4
AJMIT KUMAR
AJMIT KUMAR 2021년 1월 19일
@ Star Strider Many many thanks to you, I got the values as per my requirement. There is so much to learn about Matlab function.
Star Strider
Star Strider 2021년 1월 19일
As always, my pleasure!
Quite definitely, expecially since new functions continue to be introduced, and older ones are upgraded.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by