Borrar filtros
Borrar filtros

How to determine the value of two constants among lot of equations?

3 visualizaciones (últimos 30 días)
Chaou
Chaou el 7 de Mayo de 2013
Hello. I want to determine the value of two constants X and Y, among a lot of equations. I mean, equations such as:
2^X=3*Y
4^X=5*Y
7^X=10*Y
15^X=34*Y
..... and more.
How THE value of X and Y? Thank you very much!
  1 comentario
Matt Kindig
Matt Kindig el 7 de Mayo de 2013
Are you looking for a single value for X and Y that satisfy all of these equations? Because there does not exist a unique solution that satisfies all four of the equations you've shown.
If you take the equations two at a time, you can just use algebra to solve for X and Y by hand. I just did it, and unless my math is wrong:
Given: b1^X = a1*Y; b2^X = a2*Y
Solution: X = log(a1/a2)/log(b1/b2); Y = (1/3)*2^X

Iniciar sesión para comentar.

Respuestas (1)

Matt J
Matt J el 7 de Mayo de 2013
Editada: Matt J el 7 de Mayo de 2013
If you take the log of both sides, you will get linear equations in X and log(Y), e.g., your first 2 equations become
X*log2-log(Y)=log(3)
X*log4-log(Y)=log(5)
so you can solve using MATLAB's usual linear equation solvers
xlogy = [log([2;4]),-ones(2,1)]\log([3;5]);
x=xlogy(1), y=exp(xlogy(2))
  1 comentario
Matt J
Matt J el 7 de Mayo de 2013
For more than 2 equations, this will give you a least squares fit to X and log(Y). You'll have to decide whether that's what you want.

Iniciar sesión para comentar.

Categorías

Más información sobre Partial Differential Equation 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