Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
Chaou
Chaou le 7 Mai 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 commentaire
Matt Kindig
Matt Kindig le 7 Mai 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

Connectez-vous pour commenter.

Réponses (1)

Matt J
Matt J le 7 Mai 2013
Modifié(e) : Matt J le 7 Mai 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 commentaire
Matt J
Matt J le 7 Mai 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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Partial Differential Equation Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by