How to reverse formula
$y(x)=x (\frac{1}{sin \frac{\pi x}{2}})^\alpha$
i.e. express it as
$x = x(y)$
in Mathematica?
I did this way
Clear[α, x, y]
Solve[y == x (1/Sin[Pi x/2])^α, x]
and it answered
During evaluation of In[39]:= Solve::nsmet: This system cannot be solved with the methods available to Solve. >>
Out[40]= Solve[y == x Csc[(π x)/2]^α, x]
How to know, what prevent equation from solvation?
I have plotted formula for some values
Plot[Table[
x (1/Sin[Pi x/2])^α, {α, {-1, -0.5, 0, 0.5, 1}}], {x,
0, 1}]
and found nothing criminal in my expected domain
I have tried to add domain to the formula, but it didn't gave me answer anyway
Solve[y == x (1/Sin[Pi x/2])^α, x,
x >= 0 && x <= 1 && α >= -1 && α <= 1]
During evaluation of In[41]:= Solve::bdomv: Warning: x>=0&&x<=1&&α>=-1&&α<=1 is not a valid domain specification. Mathematica is assuming it is a variable to eliminate. >>
During evaluation of In[41]:= Solve::ivar: x>=0&&x<=1&&α>=-1&&α<=1 is not a valid variable. >>
Out[41]= Solve[y == x Csc[(π x)/2]^α, x,
x >= 0 && x <= 1 && α >= -1 && α <= 1]
How to set conditions correctly?
How to force to give computable result like as series?
UPDATE
Using InverseFunction
I wrote:
MyFun2[x_, α_] := x*(1/Sin[Pi x/2])^α
MyFunInverse2 = InverseFunction[MyFun2, 1, 2]
which gave apparently good result:
Plot[Table[MyFunInverse2[y, α], {α, -1, 1, 0.25}], {y,
0, 1}]
but trying to produce computable expression failed:
Series[MyFunInverse2[y, α], {y, 0, 5}]
Out[73]= SeriesData[y, 0, {
InverseFunction[MyFun2, 1, 2][0, α],
Derivative[1, 0][
InverseFunction[MyFun2, 1, 2]][0, α],
Rational[1, 2] Derivative[2, 0][
InverseFunction[MyFun2, 1, 2]][0, α],
Rational[1, 6] Derivative[3, 0][
InverseFunction[MyFun2, 1, 2]][0, α],
Rational[1, 24] Derivative[4, 0][
InverseFunction[MyFun2, 1, 2]][0, α],
Rational[1, 120] Derivative[5, 0][
InverseFunction[MyFun2, 1, 2]][0, α]}, 0, 6, 1]
UPDATE 2
I need to port function to C-like programming language, so final result should consist of "computable" operations. Is it possible?
How does Mathematica itself plots the result? Does just perform optimization algorithm inside? Is it really impossible to do otherwise, for example do with multivariate series?
UPDATE 3
If I take 3 terms of a series
Fwd[x_, \[Alpha]_] := x (1/Sin[Pi x/2])^\[Alpha]
In[115]:= Normal[Series[Fwd[x, \[Alpha]], {x, 0, 3}]]
Fwd1 = Function[{x, \[Alpha]}, %]
I see that result is quite applicable for me
nevertheless I can't reverse this (now much simpler) formula with neither Solve
, InverseFunction
and InverseSeries
.
Isn't it really possible to get some short numeric series with 2-3-4 terms in the case???
InverseFunction
having that $\alpha$ is an argument? $\endgroup$InverseSeries
to find the power series for $y(x)$. Note that $\alpha$ has to be an explicit rational number for this to work, though. $\endgroup$