Solving 3 Simultaneous Exponential Equations

14 visualizzazioni (ultimi 30 giorni)
I am trying to solve these 3 simultaneous exponential equations for a,b and c (This is from Vogels Viscosity Equation):
159.2543 = a*exp(b/(291.15-c))
117.2699 = a*exp(b/(293.15-c))
63.8384 = a*exp(b/(299.15-c))
I would really appriciate it if someone could show me how to write the code to solve them please!
Thank you in advance!

Risposta accettata

Star Strider
Star Strider il 20 Dic 2019
Try this:
x = [291.15; 293.15; 299.15];
y = [159.2543; 117.2699; 63.8384];
% % % MAPPING: a = b(1), b = b(2), c = b(3)
objfcn = @(b,x) b(1).*exp(b(2)./(x - b(3)));
B0 = [0.07; 450; 230];
[B,normresid] = fminsearch(@(b) norm(y - objfcn(b,x)), B0)
xv = linspace(min(x), max(x));
figure
plot(x, y, 'p')
hold on
plot(xv, objfcn(B,xv), '-r')
hold off
grid
Values of:
a = 0.970
b = 180
c = 255
give a reasonable fit to the data.
  2 Commenti
Rory Thornton
Rory Thornton il 20 Dic 2019
Great, fits the rest of my data really well too.
Thank you so much!

Accedi per commentare.

Più risposte (1)

David Goodmanson
David Goodmanson il 21 Dic 2019
HI Rory,
just for completeness
y1 = 159.2543;
y2 = 117.2699;
y3 = 63.8384;
x1 = 291.15;
x2 = 293.15;
x3 = 299.15;
A1 = log(y1/y2)/log(y2/y3);
A2 = (x2-x1)/(x3-x2);
c = (x1*A1-x3*A2)/(A1-A2);
% back substitute
b = log(y1/y2)*(x1-c)*(x2-c)/(x2-x1);
a = y1/exp(b/(x1-c));
a
b
c
a =
10.6205
b =
42.5004
c =
275.4539
% these should be small
y1 - a*exp(b/(x1-c))
y2 - a*exp(b/(x2-c))
y3 - a*exp(b/(x3-c))
ans =
0
ans =
-4.2633e-14
ans =
-7.1054e-14
The c result is fairly close to Star Strider's, but for some reason a and b differ from that result by quite a bit. The checks here show agreement at all three y points, but the best fit isn't necessarily the one that goes through all three points exactly.
  1 Commento
Rory Thornton
Rory Thornton il 22 Dic 2019
Thank you! It's just a line of best fit, there will be many viable solutions which may have very different a/b/c values. This fits the data well too.

Accedi per commentare.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by