CANNOT FIND EXPLICIT SOLUTION
Show older comments
A=6.30; B=9.40;delta=0.34;
EG0=1.519;a=0.472*10^(-3);seta=230;p=2.44;
T1=293.15;T2=373.15;
y=900*10^(-9):10^(-9):1700*10^(-9);
h=4.13566*10^(-15);
EG1=EG0-a*seta*0.5*(power(1+((2*T1)/seta)^p,1/p)-1);
EG2=EG0-a*seta*0.5*(power(1+((2*T2)/seta)^p,1/p)-1);
EG3=EG0-a*seta*0.5*(power(1+((2*300)/seta)^p,1/p)-1);
syms nr
c=299792452;
hw=(h*c)./(nr*y);
x1=hw/EG1; x2=hw/(EG1+delta);
fx1=power(x1,-2).*(2-sqrt(1+x1)-sqrt(1-x1));
fx2=power(x2,-2).*(2-sqrt(1+x2)-sqrt(1-x2));
eq=nr^2-A*(fx1+0.5*fx2*(EG1/(EG1+delta))^1.5)-B
solve(eq,nr);
I don't know how to solve the 'nr'. The only unknown number is nr, But MATLAB says 'Cannot find explicit solution.' In solve(line 316). how can I solve it?
Answers (1)
Jesús Zambrano
on 29 Mar 2020
Hi Jiyoung,
What I see from your code is that there is a variable 'y' which is a vector of 801 elements. Thas makes you to have, after following the rest of lines in the code, 801 elements in your 'eq'. I guess you want to solve each element of 'eq' for 'nr', right?
If so, then put the solve in a for-loop that executes it for each elements of the vector 'eq'. Note that when you solve it for the first element, i.e. eq(1), you will get:
solve(eq(1),nr)
ans =
-3.4055195247431015387149927562818
3.4055195247431015387149927562818
- 0.23371803267167591292641549805172 - 0.84472889222660849307066527049399i
- 0.23371803267167591292641549805172 + 0.84472889222660849307066527049399i
- 0.2188548808156796407592891677842 - 1.2614207237196718736658771540873i
- 0.2188548808156796407592891677842 + 1.2614207237196718736658771540873i
- 0.2009831298087114922620258832011 - 0.63984098829267138761023290039748i
- 0.2009831298087114922620258832011 + 0.63984098829267138761023290039748i
- 0.095279410850735997800776403284443 - 0.55834240108227279261730458860913i
- 0.095279410850735997800776403284443 + 0.55834240108227279261730458860913i
- 0.073816698835835126920532553463148 - 0.67770646926384383539367083081255i
- 0.073816698835835126920532553463148 + 0.67770646926384383539367083081255i
- 0.035279698323879157508614161138525 - 0.50104079719727104870701077365044i
- 0.035279698323879157508614161138525 + 0.50104079719727104870701077365044i
- 5.3926038442842603885567382392378e-33 - 0.58125154905583862889817538507886i
- 5.3926038442842603885567382392378e-33 + 0.58125154905583862889817538507886i
- 7.7037197775489434122239117703397e-34 - 0.84730569050904191778663882760979i
- 7.7037197775489434122239117703397e-34 + 0.84730569050904191778663882760979i
0.000000000000000000000000000000014637067577342992483225432363645 - 0.44729847829331506330489730016435i
0.000000000000000000000000000000014637067577342992483225432363645 + 0.44729847829331506330489730016435i
0.035279698323879157508614161138514 - 0.50104079719727104870701077365046i
0.035279698323879157508614161138514 + 0.50104079719727104870701077365046i
0.073816698835835126920532553463143 - 0.67770646926384383539367083081256i
0.073816698835835126920532553463143 + 0.67770646926384383539367083081256i
0.095279410850735997800776403284446 - 0.55834240108227279261730458860914i
0.095279410850735997800776403284446 + 0.55834240108227279261730458860914i
0.2009831298087114922620258832011 - 0.63984098829267138761023290039749i
0.2009831298087114922620258832011 + 0.63984098829267138761023290039749i
0.2188548808156796407592891677842 - 1.2614207237196718736658771540873i
0.2188548808156796407592891677842 + 1.2614207237196718736658771540873i
0.23371803267167591292641549805172 - 0.84472889222660849307066527049399i
0.23371803267167591292641549805172 + 0.84472889222660849307066527049399i
Also, try to use the command 'vpa' so to simplify coefficient on symbolic fractions before use 'solve'. This might reduce a lot the time it takes for 'solve' to give the numerical results.
Hope this can help to solve the problem.
4 Comments
Walter Roberson
on 29 Mar 2020
However if you are going to use vpa to simplify the coefficients then you should probably be using vpasolve. solve() is for exact solutions as much as possible.
Jesús Zambrano
on 29 Mar 2020
Good suggestions, thanks!
Jiyoung Lee
on 30 Mar 2020
Jesús Zambrano
on 30 Mar 2020
Sure, then plot 'nr1' agains 'nr'.
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!