Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.3K Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How to get the function expression from InverseFunction instruction

I am using InverseFunction command and when I get the result (that is correct) I obtain a string like that:

Function[K$57068, 
 ConditionalExpression[
  Root[256. Re[K$57068]^2 - 576. #1 + 432. #1^2 - 108. #1^3 + 
     9. #1^4 &, 1], 0 < Re[K$57068] <= 0.974279 && Im[K$57068] == 0]]

Now I want to get the polinomial function without all the other information (like ConditionalExpression, Root, Re, ....) so that I may use it, for example, as a boundary condition for solving some differential Equations. Somebody knows some commands to get the clean function (like: ax^4+bx^3+cx^2+dx+e)? I have tried a lot commands but without success.
I thank you in advance,
Antonio

POSTED BY: Antonio Peretto
4 Replies

More ways:

fn = Function[K$57068, 
   ConditionalExpression[
    Root[256. Re[K$57068]^2 - 576. #1 + 432. #1^2 - 108. #1^3 + 
       9. #1^4 &, 1], 
    0 < Re[K$57068] <= 0.974279 && Im[K$57068] == 0]];

First@Cases[fn, Root[f_, __] :> f[x], Infinity]
(*  -576. x + 432. x^2 - 108. x^3 + 9. x^4 + 256. Re[K$57068]^2  *)

First@Cases[fn, Root[f_, __] :> f[x] - f[0], Infinity]
(*  0. - 576. x + 432. x^2 - 108. x^3 + 9. x^4  *)
POSTED BY: Michael Rogers

Dear Bill it works!! now the problem is to CUT Re[K57068]^2 which number changes every run so it is not a fixed string. I thank you a lot if you have further suggestions. Antonio

POSTED BY: Antonio Peretto
Posted 2 years ago

That did seem oddly formatted. Perhaps this will be close enough

Function[K57068,ConditionalExpression[Root[256.Re[K57068]^2-576.#1+432.#1^2-
  108.#1^3+9.#1^4 &,1],0<Re[K57068]<=0.974279&&Im[K57068]==0]][[2,1,1,1]]/.{#1->x,Re[_]->0}

which returns

0. - 576.*x + 432.*x^2 - 108.*x^3 + 9.*x^4

Be careful with this. I wouldn't want to get you into trouble.

POSTED BY: Bill Nelson
Posted 2 years ago

Does this get you part of the way there?

Function[K57068,ConditionalExpression[Root[256.Re[K57068]^2-576.#1+432.#1^2-
   108.#1^3+9.#1^4 &,1],0<Re[K57068]<=0.974279&&Im[K57068]==0]][[2,1,1,1]]/.#1->x

which returns

-576.*x + 432.*x^2 - 108.*x^3 + 9.*x^4 + 256.*Re[K57068]^2

There may be better ways of doing this, but this uses simple brute force [[]] to extract smaller and smaller parts of this until it gets to your polynomial and then uses /. to replace #1 with x. You may want to do one further replacement on that Re[K57068] but I am uncertain what you want to do with that. Be very careful with this and test it before you trust it.

POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard