Solving Equation Depending on Parameter
Ältere Kommentare anzeigen
Hello,
An equation in a reference paper has been simply translated into a Matlab code (see below) for solving it, and it must have particular values of x depending on the parameter "gamma", but I got an error. Would you check the equation and answer me what I need to make a correction?
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);
1 Kommentar
You should put your code in a nice format. I cannot say which parts are comment which parts are not. For instance, you cannot do
syms x gamma=(a_p*k*k_2)/(k_p*m1*k_1);
in a single line. It should be
syms x
gamma = (a_p*k*k_2)/(k_p*m1*k_1);
Is it due to your copy paste or do you actually use it this way cannot be determined from your question.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Linear Algebra finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!