How to find the value from equations?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Chuanjung Lin
am 5 Aug. 2022
Kommentiert: Walter Roberson
am 8 Aug. 2022
Hi all,
I have a dataset (Ids) and equestion as the attachment.
Ids = [6.35E-06
6.18E-06
6.01E-06
5.84E-06
5.68E-06
5.52E-06
5.36E-06
5.20E-06
5.05E-06
4.89E-06
4.75E-06
4.60E-06
4.45E-06
4.31E-06
4.17E-06
4.03E-06
3.90E-06
3.76E-06
3.63E-06
3.50E-06
3.38E-06
3.25E-06
3.13E-06
3.01E-06
2.90E-06
2.78E-06
2.67E-06
2.56E-06
2.45E-06
2.35E-06
2.25E-06
2.15E-06
2.05E-06
1.95E-06
1.86E-06
1.77E-06
1.68E-06
1.60E-06
1.51E-06
1.43E-06
1.35E-06
1.28E-06
1.20E-06
1.13E-06
1.06E-06
9.95E-07
9.30E-07
8.68E-07
8.08E-07
7.50E-07
6.95E-07
6.41E-07
5.90E-07
5.41E-07
4.95E-07
4.51E-07
4.09E-07
3.69E-07
3.31E-07
2.95E-07
2.62E-07
2.31E-07
2.02E-07
1.75E-07
1.50E-07
1.27E-07
1.06E-07
8.77E-08
7.09E-08
5.60E-08
4.31E-08
3.20E-08
2.28E-08
1.52E-08
9.39E-09
5.11E-09
2.28E-09
7.14E-10
1.12E-10
6.28E-12
2.10E-13
6.54E-15
3.27E-16
-2.03E-16
-2.06E-16
4.78E-16
3.29E-16
-3.03E-16
4.10E-16];
where, the Wg = 6; Lg = 2.3;
may I know how to obtain the Ids'?
Here, I set Ids' = a , and code as following:
Wg = 6;
Lg = 2.3;
syms a
eqn = (1*10^(-5)).*(Wg./Lg)* log10( 1 + exp(a./5)) ./ ( 1 + exp(a./5))==Ids
S = solve(eqn);
S
when I click the run, it seems no response. Does this approach is correct?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 5 Aug. 2022
eqn = (1*10^(-5)).*(Wg./Lg)* log10( 1 + exp(a./5)) ./ ( 1 + exp(a./5))==Ids
IDS is a vector, so eqn is a vector. But syms a is a scalar symbolic variable.
S = solve(eqn);
You are asking to solve the vector of equations for the single scalar value for a that solves all of the equations simultaneously. That is not going to exist.
Are you looking for "best fit" or are you looking to solve each of the equations independently ?
3 Kommentare
Walter Roberson
am 8 Aug. 2022
Are you looking for "best fit" or are you looking to solve each of the equations independently ? The code I posted shows the best fit in a least-squares sense. If you want to solve each individually then loop or use arrayfun.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Conversion Between Symbolic and Numeric finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!