Azzera filtri
Azzera filtri

Solving 3 equations with 3 unknowns

83 visualizzazioni (ultimi 30 giorni)
Hamza
Hamza il 5 Mar 2013
Dear members;
I would like to solve 3 equations using matlab. following are the 3 equations.
0.0972=ve*ln(mo/(mo-1010mp))
0.11285=ve*ln((mo-1010mp)/(mo-2145mp))
0.10953=ve*ln((mo-2145mp)/(mo-3395mp))
The unknowns in these equations are ve, mo and mp. is there a way to solve for the unknowns?
Thanks in advance

Risposte (3)

Azzi Abdelmalek
Azzi Abdelmalek il 5 Mar 2013
syms me ve mo mp
eq1=0.0972-ve*log(mo/me)
eq2=0.11285-ve*log((mo-1010*mp)/(mo-2145*mp))
eq3=0.10953-ve*log((mo-2145*mp)/(mo-3395*mp))
solve(eq1,eq2,eq3,ve,mo,mp)
  1 Commento
Hamza
Hamza il 5 Mar 2013
thanks But i guess i don't have the symbolic maths toolbox. can you post me the answers please?
And you can replace 'me' with '(mo-1010mp)' Thanks

Accedi per commentare.


Youssef  Khmou
Youssef Khmou il 5 Mar 2013
hi try ,
D=solve('x*log(y/a)=0.0972','x*log((y-1010*z)/(y-2145*z))=0.11285','x*log((y-2145*z)/(y-3395*z))=0.10953','x','y','z')
what is me? it is replaced with a
  6 Commenti
Walter Roberson
Walter Roberson il 6 Mar 2013
Modificato: Walter Roberson il 6 Mar 2013
One solution is
mo = me, mp = 0, ve = infinity
There might be other solutions; I have my system checking.
... There do not appear to be any other real solutions.
Hamza
Hamza il 6 Mar 2013
these results are based on the new first equation which I have edited?

Accedi per commentare.


Roger Stafford
Roger Stafford il 6 Mar 2013
I claim there are either no solutions or infinitely many solutions to your three equations, and I'll tell you why, Hamza. By manipulating the equations appropriately one can rewrite them in the form:
exp(0.0972/ve) = 1/(1-1010*r)
exp(0.11285/ve) = (1-1010*r)/(1-2145*r)
exp(0.10953/ve) = (1-2145*r)/(1-3395*r)
where r = mp/mo. As you can see from this, you have in effect three equations but only two unknowns, namely 've' and 'r', and they are unlikely to have a solution. You can find out if that is so by solving, say, just the first two of these equations. These two can be expressed as:
1-1010*r = exp(-0.0972/ve)
1-2145*r = (1-2145*r)/(1-1010*r) * (1-1010*r)
= exp(-0.11285/ve)*exp(-0.0972/ve)
= exp(-.21005/ve)
Solving for r in each equation gives
r = (1-exp(-0.0972/ve))/1010 = (1-exp(-.21005/ve))/2145
2145*(1-exp(-0.0972/ve)) = 1010*(1-exp(-.21005/ve))
1010*exp(-.21005/ve)-2145*exp(-0.0972/ve)+1135 = 0
You can use matlab's 'fzero' to solve this last equation for 've' and from that determine 'r'. As I say, any such solutions are unlikely to also satisfy the third equation above. If they do, then you will have infinitely many solutions corresponding to all the ways of satisfying r = mp/mo.

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by