Finding Explicit Solution to an Equation

5 vues (au cours des 30 derniers jours)
onsagerian
onsagerian le 24 Juil 2018
Commenté : Star Strider le 25 Juil 2018
Hello,
I am trying to find out the explicit solution to the following equation. I set up the "Condition" field with the help of a Matlab user, yet I failed to get an outcome. (No error message, but No response) Would you check my code, in particular, the last part which contains the equation and let me know what I need to do to get a proper solution? (I am using R2017b version)
format long e
T=0.1;
k=1.0; %k(1) default value is 1.0
k_1=0.2; %k(-1) default value is 2.0 (modified: 1.0)
k_2=0.00001; %k(-1*) default value is 0.1 (Note: k_2=0.00001 higher error rate for n=1 compared to n>1)
%k_2=[0.1:0.1:1.0];
a_p=0.0001; %k(p) default value is 0.0001
k_p=a_p/10; %k(-p) Assuming this ratio is the constant (a_p/10)
a_q=0.00015; %k(q) default value is 0.00015
k_q=0.00002; %k(-q) default value is 0.00002
theta=0.01; %default value is 0.01
m1=0.0000005; %default value is 0.0000005
m2=0.0000002; %default value is 0.0000002
W=0.00002; %default value is 0.002
n=6;
syms x
gamma=(a_p*k*k_2)/(k_p*m1*k_1);
equation=gamma-[1+(theta-x)/(1-theta)*[(1-theta)/(x^(1/(n+1))-theta)]^(n+1)]==0;
sol=solve(equation,x,'ReturnConditions',1);

Réponse acceptée

Star Strider
Star Strider le 25 Juil 2018
This works for me in R2018a:
... CODE ...
sol=solve(equation,x,'ReturnConditions',1);
x = vpa(solve(sol.conditions))
x =
0.2014042781988740154717685102689
What version of MATLAB are you using? Have you kept it updated? (If not, see: Matlab 2018a faulty? for help in updating it.)

Plus de réponses (1)

onsagerian
onsagerian le 25 Juil 2018
Modifié(e) : onsagerian le 25 Juil 2018
Thank you. It works! I did not put the last command "x = vpa(solve(sol.conditions))". I need to learn about handling Matlab solvers.
  1 commentaire
Star Strider
Star Strider le 25 Juil 2018
As always, my pleasure!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by