1
$\begingroup$

Warning: very new to Mathematica Currently I am trying to solve for x, but the variable K changes. So I'd like a value for x, for every K. However, this equation below gives me 2 complex numbers and 2 real, of which 1 real value is positive. I'm not sure how possible it would be to get an output of either all possible solutions (both complex and real) or just the one positive value that I want.

((x^4) / (3906250*K)) - (1 - x) == 0 

Different values for K:

{5.16 E - 16, 5.29 E - 16, 5.43 E - 16, 5.57 E - 16, 5.72 E - 16, 
 5.87 E - 16, 6.02 E - 16}
$\endgroup$
  • $\begingroup$ It's unclear to me how you get from the first line to the second. Have you tried Solve[((x^4)/(3906250*k)) - (1 - x) == 0, x, Reals]? You can use ToRadicals to convert the Root objects Mathematica returns to explicit roots and powers. $\endgroup$ – Sjoerd Smit Sep 23 at 15:21
  • $\begingroup$ The first line doesn't give the second line. The first line is my equation, and I want an x for certain values of K (listed in the second line). So I have tried the "real" part of solving an equation, but I wanted to know if there is a way I could solve for x for each "K" value, without having to input it manually. In other words, I'd like the output to be a value of x corresponding to it's respective "K." $\endgroup$ – Minnie D Sep 23 at 15:28
0
$\begingroup$

This will give you all solutions for the list of K values.

sol = Solve[((x^4)/(3906250*K)) - (1 - x) == 0, x];

sol /. K -> # & /@ {5.16 E - 16, 5.29 E - 16, 5.43 E - 16, 
  5.57 E - 16, 5.72 E - 16, 5.87 E - 16, 6.02 E - 16}
$\endgroup$
  • $\begingroup$ This worked beautifully! Thanks so much! $\endgroup$ – Minnie D Sep 23 at 18:05
0
$\begingroup$

You can use Solve to find the real roots:

roots = x /. Solve[x^4/(3906250 K) - (1 - x) == 0, x, Reals]

{ConditionalExpression[Root[-3906250 K + 3906250 K #1 + #1^4 &, 1], K > 0 || K < -(128/52734375)], ConditionalExpression[Root[-3906250 K + 3906250 K #1 + #1^4 &, 2], K > 0 || K < -(128/52734375)]}

Let's check whether the first solution is positive for K>0:

Reduce[roots[[1]] > 0 && K > 0]

False

So, the only positive real root must be the second one:

pos[K_] = Simplify[roots[[2]], K > 0]

Root[-3906250 K + 3906250 K #1 + #1^4 &, 2]

Visualization:

Plot[pos[K], {K, 0, 10^-6}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.