How to findout this equations value
1 view (last 30 days)
Show older comments
Sourasis Chattopadhyay
on 5 Jul 2022
R*e^15b=35.75
R*e^25b=29.125
R*e^35b=22.875
I need to find out the value of R and b from above equaations. Is there any command in matlab to findout this calculation?
0 Comments
Accepted Answer
John D'Errico
on 5 Jul 2022
Edited: John D'Errico
on 5 Jul 2022
That is impossible, since your equations are not written in unambiguous mathematics.
Is e^15b intended to mean exp(15*b)?
Is e^15b intended to mean exp(15)*b?
Is e the base of the natural logarithem? Thus
format long
exp(1)
Even if as I suspect, you actually have these equations:
syms R b
E1 = R*exp(15*b) == 35.75;
E2 = R*exp(25*b) == 29.125;
E3 = R*exp(35*b) == 22.875;
then no unique solution can possibly exist. That is, divide equation 2 by equation 1. That leaves us with
E2/E1
As you can see, R goes away, and we could compute b from that relation.
vpa(solve(E2/E1))
However, suppose we chose to do this instead?
E3/E1
vpa(solve(E3/E1))
And finally, we could do this:
vpa(solve(E3/E2))
Which as you see, returns a completely different result for b. And when we do so, depending on the value of b we chose from how we might derive it, then R is also completely different.
0 Comments
More Answers (2)
Saksham Gupta
on 5 Jul 2022
As per my understanding, you wish to solve the given equations
You may use the following code to solve them:
syms R b
eqns = [ R*exp(15*b) == 35.75 , R*exp(25*b) == 29.125 ];
a = solve( eqns , [ R ,b ] );
disp(a.R);
disp(a.b);
I am using 2 equations only as I am able to identify only 2 variables : 'R' and 'b'.
My output is:
0 Comments
Sam Chak
on 5 Jul 2022
R12 = 48.6173; % solving Eqn 1 and Eqn 2 simultaneously
R23 = 53.2756; % solving Eqn 2 and Eqn 3 simultaneously
R31 = 49.9703; % solving Eqn 3 and Eqn 1 simultaneously
b12 = -0.020495335725415202423043826631973699411349908259696363801512111;
b23 = -0.024155230072427962515559053432074702762580354955690539307109413;
b31 = -0.022325282898921582469301440032024201086965131607693451554310762;
x = linspace(10, 40, 3001);
y1 = R12*exp(b12*x);
y2 = R23*exp(b23*x);
y3 = R31*exp(b31*x);
plot(x', [y1' y2' y3'], 'LineWidth', 1.5), grid on, hold on,
plot([15 25 35], [35.75 29.125 22.875], 'mo', 'MarkerSize', 12, 'LineWidth', 2), hold off
xlabel('x'), ylabel('y'),
legend('y1', 'y2', 'y3')
0 Comments
See Also
Categories
Find more on Symbolic Math Toolbox 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!