How to find the value from equations?
1 次查看(过去 30 天)
显示 更早的评论
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];
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1088745/image.png)
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 个评论
采纳的回答
Walter Roberson
2022-8-5
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 个评论
Walter Roberson
2022-8-8
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.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!