Useful results from solve function

조회 수: 4 (최근 30일)
Florian Hölscher
Florian Hölscher 2021년 5월 31일
댓글: Torsten 2021년 6월 1일
Hey,
I'm trying to solve 2 equations using the solve function. The first one for beta, the second one for lambdai. For the first equation, I get the following results: S = [x z1]
for the second one I get the error: Warning: Unable to find explicit solution.
I tried the help page, which suggested assumptions and some other things, but nothing that worked. Does anyone know how to solve these?
This is the code with the equations:
%%Equation 1
syms lambdai lambda beta
eqn = lambdai == 1/(1/(lambda+0.08*beta)-0.035/(beta^3+1));
S = solve(eqn,beta);
%% Equation 2
syms lambdai lambda beta cp c1 c2 c3 c4 c5 c6
eqn = cp == c1*(c2/lambdai-c3*beta-c4)*exp(-c5/lambdai)+c6*lambda;
Q = solve(eqn,lambdai);
c1 to c6 are constants, in case that helps..
  댓글 수: 2
Torsten
Torsten 2021년 5월 31일
편집: Torsten 2021년 6월 1일
For the second equation, Wolframalpha gives a solution involving the "analytic continuation of the product log function", thus very special and hard to use in practise.
The first one gives a polynomial equation of degree 4 in beta. The form and number of solutions depend on the numerical values of lambda and lambdai.
Florian Hölscher
Florian Hölscher 2021년 6월 1일
This is for the second equation? But atleast the first one should be easier to solve?

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

답변 (1개)

Steven Lord
Steven Lord 2021년 5월 31일
Try substituting values for the constants c1 through c6 and cp before trying to solve it.
I expect that you're going to argue that you want a general solution that is a function of the constants. But the more general the equation is the more difficult it is likely to be to solve. If you tell me "I want something to eat" I may have to suggest a number of different food items before hitting upon the one thing you had in mind. If you tell me "I want a cookie" the "parameter space" is a lot easier to search. [And now I think it's time for me to get lunch.]
  댓글 수: 3
Florian Hölscher
Florian Hölscher 2021년 6월 1일
What actually works for the second eqn is if I give values for c1-6, cp and lambda. However, I need cp and lambda as variables in my output eqn..
%% Equation 2
syms lambdai lambda beta cp c1 c2 c3 c4 c5 c6
eqn = cp == 0.5176*(116/lambdai-0.4*beta-5)*exp(-21/lambdai)+0.0068*4.8;
Q = solve(eqn,lambdai)
Result:
Q =
1/(beta/290 - lambertw(-1, -(325983*exp((21*beta)/290 + 105/116))/187630)/21 + 5/116)
Torsten
Torsten 2021년 6월 1일
Use
solve cp == c1*(c2/lamdai - c3*beta - c4)*exp(-c5/lambdai) + c6*lambda , x
under
wolframalpha.com and experiment with your equations.
As Steven Lord said, it does not make much sense to work with solutions to equations of such generality because in the end, all parameters will be substituted by numerical values and vpasolve will most probably be successful.

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

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by