Solve an equation with two variables
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I need to solve this equation for the unknowns E_fb and E_ft, with all other known constants.

I have written the following code, and it gives me this error:
sol=solve(['CTOX/e*(e*Vtg-10e17*e*(Ect-Eft)-e*Vds+chiT*q-ePhi*q)-Cvdw/e*(e*Vds-e*10e17*(Efb-Evb)-e*10e17*(Ect-Eft)+Egb*q+chiB*q-chiT*q)=e*(gv*kb*T/(pi*hbarra2))*(mv*log(exp(-q*(Eft-Evt)/(kb*t))+1)-mc*log(exp(-q*(Ect-Eft)/(kb*t))+1))','CBOX/e*(e*Vbg-10e17*e*(Efb-Evb)-Egb*q+chiB*q-ePhiB*q)-Cvdw/e*(e*Vds-e*10e17*(Efb-Evb)-e*10e17*(Ect-Eft)+Egb*q+chiB*q-chiT*q)=e*(gv*kb*T/(pi*hbarra2))*(mv*log(exp(-q*(Efb-Evb)/(kb*t))+1)-mc*log(exp(-q*(Ecb-Efb)/(kb*t))+1))'],[Eft,Efb])
Undefined function or variable 'Eft'.
Thanks for your help.
2 Commenti
Walter Roberson
il 17 Lug 2017
Could you confirm that you mean 10e17, which is 10^18 ? Or did you mean 10^17 which is 1E17 ?
Walter Roberson
il 17 Lug 2017
I am confused as to where you are getting two equations from this? I do see two "=" but one is at the end of a line and the other is the beginning of the next line so plausibly that is indicating a single equality.
Risposte (1)
John D'Errico
il 17 Lug 2017
Are the variables Eft and Efb defined as symbolic variables, before you did this? (No)
So first, start by defining them.
syms Eft Efb
Next, to create a symbolic equality relationship, use == instead of = in the expression.
I have a funny feeling there will be no solution anyway, If so, then so solve will return an empty result. But hey, you might get lucky.
3 Commenti
Walter Roberson
il 18 Lug 2017
You have a "clear all" but you do not "syms" phint or phipb into existence before using them.
What does it mean to have found a supposedly exact solution to equations involving coefficients that are low-precision and clearly rounded of ??
It is possible to find symbolic solutions to the equations involving a term which is a root of an expression that has no closed form solution. Furthermore this expression in turn involves a subexpression which is a root of an expression that has no closed form solution. There are four solution pairs because the outer expression is kind of quartic.
The inner root has at least two different solutions; one of them is imaginary valued, and the other is real valued and approximately 8.531*10^(-19). The slope of the equation at the point of its real solution is approximately 10^131, so you will not actually be able to find the zero unless you are operating on at least 131 digits of precision. And that is just for the inner of the nested roots; I have not investigated the precision necessary to find the outer level.
You appear to have found the real component of sol1, but my tests suggest that the imaginary component on the order of -2E-36 is not negligible -- and with the functions being so steep, it is not surprising that you might get a value quite different from 0 when you substitute in.
My calculation is that there should be a complete second set of solutions.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!