Hi,How can i solve a formula
Show older comments
y(2)=x(2)/E+(x(2)/K))^(1/n) where x(1)*y(1)=x(2)*y(2) ,the K,E and n are known
3 Comments
Walter Roberson
on 7 Nov 2012
Please use meaningful tags; see http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags
Walter Roberson
on 7 Nov 2012
When you say "solve" do you mean that this is a recurrence equation ?
Maryam Gharib
on 11 Nov 2012
Answers (2)
Sean de Wolski
on 7 Nov 2012
doc solve
Walter Roberson
on 12 Nov 2012
With the information given, there is no easy solution for y(2). y(2) is
RootOf(Z^2*E-x(1)*y(1)-(x(1)*y(1)/(Z*K))^(1/n)*Z*E, Z)
which is to say the set of values Z such that the Z^2(etc) expression becomes 0. It is difficult to characterize those expressions without knowing the ranges of the values.
Note: it is not a recurrence equation.
2 Comments
Maryam Gharib
on 21 Nov 2012
Walter Roberson
on 21 Nov 2012
You can rewrite the RootOf() in terms of one variable, XY = x(1)*y(1)
RootOf(Z^2*E-XY-(xy/(Z*K))^(1/n)*Z*E, Z)
with K being constant and positive, it can be moved out of the term it is in, leaving a term (XY/Z)^(1/n) . Z is the potential root that makes the overall expression 0. The sign of XY/Z is currently indeterminate: we do not know sign(x(1)*y(1)) and we do not know sign(Z). So in the general case we need to assume that XY/Z might be negative or complex. As such it becomes important what the exact power (1/n) is, because if n is not an odd integer, (XY/Z)^(1/n) is potentially necessarily complex (which does not mean that the root Z will necessarily be complex.) 0.150 is not, on the face of things, an odd integer, but since it is a floating point number we have to assume it is in lowest terms rather than being in algebraic form -- but there are algebraic forms for it that have odd denominators and there are algebraic forms for it that have even denominators, leaving it unknowable as to whether the power of 1/0.150 forms complex results or not. The only semi-standard definition of what a floating-point power means is to define the exponentiation operation in terms of log(), in which case of XY/Z is negative, then (XY/Z)^(1/n) would come out complex. Algebraic analysis of where the roots are of an expression involving complex logs is No Fun.
In at least one meaningful interpretation of ^(1/0.150), the branch that has real-valued roots for x(1)*y(1) < 0, also has negative roots where x(1)*y(1) crosses over to positive, and there is also (in that interpretation) a branch in which all the roots are negative, and there is a third branch which is strictly positive over x(1)*y(1) positive. But a different meaningful interpretation of ^(1/0.150) instead has a infinite singularity at about x(1)*y(1) about equal to 0.4 .
So, Yes, the ranges are still important, as is your intended meaning for raising a value to a floating point power.
Categories
Find more on Common Operations 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!