I wish to solve this function for PCOAL
.
q == (0.0238849 PCOAL + 0.903548 PCOAL^1.86)
If an algebraic solution is not possible, I'd like to ask Mathamatica for an approximation, PCOAL = something_without_PCOAL / q
Let us write p
instead of PCOAL
for the sake of shortness, and first let us plot your equation at, say, q=0.5
:
Plot[{0.5, (0.0238849*p + 0.903548 p^1.86)}, {p, 0, 1},
AxesLabel -> {Style["p", Italic, 16], Style["q", Italic, 16]}]
You get, thus, a single solution which is roughly close to q^1/2
. It can be now obtained numerically using the FindRoot
routine:
lst = Table[{q,
FindRoot[0.0238849*p + 0.903548 p^1.86 == q, {p, Sqrt[q] // N}][[1,
2]]}, {q, 0, 1, 0.1}]
(* {{0., 0.}, {0.1, 0.294456}, {0.2, 0.432039}, {0.3, 0.539891}, {0.4,
0.632052}, {0.5, 0.71406}, {0.6, 0.788786}, {0.7, 0.857954}, {0.8,
0.922694}, {0.9, 0.983794}, {1., 1.04183}} *)
This solution may be then fitted to some analytical function entitled "model":
model = a*q^0.6 + b*q;
ff = FindFit[lst, model, {a, b}, q]
(* {a -> 1.22995, b -> -0.190771} *)
we can visually check the fit quality as follows:
Show[{
ListPlot[lst,
AxesLabel -> {Style["q", Italic, 16], Style["p", Italic, 16]}],
Plot[model /. ff, {q, 0, 1}, PlotStyle -> Red]
}]
yielding
Done. Have fun!
s = p /. First@Solve[q == (0.0238849 p + 0.903548 p^1.86), p]; Plot[s, {q, 0, 1}, PerformanceGoal -> "Speed"]
.
$\endgroup$
Sep 5, 2016 at 15:56
Let us make your equation little bit more general:
q == a x + b x^p
or
q - a x==b x^p
where in your case
a=0.0238849;
b=0.903548;
p=1.86;
One can find a progression of approximations for $x$ (PCOAL) in your case by the following recursion:
z[0] = (q/b)^(1/p);
Table[z[i] = (q - b (1 - p) z[i - 1]^p)/(b p z[i - 1]^(p - 1) + a);
z[i], {i, 3}]
This is kind of the Newton method. In most of the cases the zeroth order approximation is sufficient, i.e. x=z[0]
. For more precision you can take x=z[1]
which explicitly means x=(p q)/(a + p (b/q)^(1/p) q)
. This is already quite accurate.
PCOAL=(1.86 q)/(0.0238849 + 1.76129 q^0.462366)
Solve
in the documentation? $\endgroup$Solve
is the right approach, but it yields 93 solutions. In most cases, all but one of these are complex. So, the question is, which of these is desired? $\endgroup$