How to findout this equations value

1 visualización (últimos 30 días)
Sourasis Chattopadhyay
Sourasis Chattopadhyay el 5 de Jul. de 2022
Respondida: Sam Chak el 5 de Jul. de 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?

Respuesta aceptada

John D'Errico
John D'Errico el 5 de Jul. de 2022
Editada: John D'Errico el 5 de Jul. de 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)
ans =
2.718281828459045
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
ans = 
As you can see, R goes away, and we could compute b from that relation.
vpa(solve(E2/E1))
ans = 
However, suppose we chose to do this instead?
E3/E1
ans = 
vpa(solve(E3/E1))
ans = 
And finally, we could do this:
vpa(solve(E3/E2))
ans = 
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.

Más respuestas (2)

Saksham Gupta
Saksham Gupta el 5 de Jul. de 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:
You may refer to documentation of solve to learn more about it.

Sam Chak
Sam Chak el 5 de Jul. de 2022
You can try using the solve() command.
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')

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by