-3
$\begingroup$

I am using this code.

wn = 100;
aap = 0.2;
ome = 9;
Solve[{(2 x + 2) ((dco - wn aap x)^2 + 1) + 4*ome*x == 0}, {x}] 
Plot[{x /. %}, {dco, -40, 0}]

I am using this upper code and getting the right graph. But the Problem is that I do not want the result in this form as it is showing like this: I want to calculate roots.

{{x -> 0.0333333 (-10. + dco) + ((5.20833*10^-6 - 9.0211*10^-6 I) (-548800. - 64000. dco - 1600. dco^2))/(-6560. - 1371. dco - 60. dco^2 - 1. dco^3 + 5.19615 Sqrt[ 99259. + 143320. dco + 24722. dco^2 + 1160. dco^3 + 19. dco^4])^( 1/3) - (0.00833333 + 0.0144338 I) (-6560. - 1371. dco - 60. dco^2 - 1. dco^3 + 5.19615 Sqrt[ 99259. + 143320. dco + 24722. dco^2 + 1160. dco^3 + 19. dco^4])^(1/3)}, {x -> 0.0333333 (-10. + dco) + ((5.20833*10^-6 + 9.0211*10^-6 I) (-548800. - 64000. dco - 1600. dco^2))/(-6560. - 1371. dco - 60. dco^2 - 1. dco^3 + 5.19615 Sqrt[ 99259. + 143320. dco + 24722. dco^2 + 1160. dco^3 + 19. dco^4])^( 1/3) - (0.00833333 - 0.0144338 I) (-6560. - 1371. dco - 60. dco^2 - 1. dco^3 + 5.19615 Sqrt[ 99259. + 143320. dco + 24722. dco^2 + 1160. dco^3 + 19. dco^4])^(1/3)}, {x -> 0.0333333 (-10. + dco) - ( 0.0000104167 (-548800. - 64000. dco - 1600. dco^2))/(-6560. - 1371. dco - 60. dco^2 - 1. dco^3 + 5.19615 Sqrt[ 99259. + 143320. dco + 24722. dco^2 + 1160. dco^3 + 19. dco^4])^(1/3) + 0.0166667 (-6560. - 1371. dco - 60. dco^2 - 1. dco^3 + 5.19615 Sqrt[ 99259. + 143320. dco + 24722. dco^2 + 1160. dco^3 + 19. dco^4])^(1/3)}}

I want my answer in interpolation form. I think you can help me.

$\endgroup$
  • 1
    $\begingroup$ @vijay Okay, after deleting and inserting several spaces, I am confident that I was able to reproduce the code that you actually used. Please, always copy the code (in input form) from you notebook to your post. Otherwise, important information might be lost. $\endgroup$ – Henrik Schumacher Feb 5 at 9:40
  • 1
    $\begingroup$ @vijay It is still unclear what you want because you attempt to solve a polynomial equation of order three. What you see is are the three general solution of which one or more may be complex. The plotting routine returns nonreal input. $\endgroup$ – Henrik Schumacher Feb 5 at 9:43
  • $\begingroup$ @gwr Sorry, now question is clear. i have edited it. i want to find out roots and plot it. $\endgroup$ – vijay Feb 5 at 10:31
  • $\begingroup$ Have you tried Reduce[{(2 x + 2) ((dco - wn aap x)^2 + 1) + 4*ome*x == 0}, {x}]? You can convert the conditions to rules for plotting by using ToRules. $\endgroup$ – gwr Feb 5 at 13:32
2
$\begingroup$
wn = 100;
aap = 1/5;
ome = 9;

sol = Solve[{(2 x + 2) ((dco - wn aap x)^2 + 1) + 4*ome*x == 0}, x] // 
  FullSimplify

(* {{x -> 1/30 (-10 + dco) + (343 + 
       dco (40 + dco))/(60 (-6560 - dco (1371 + dco (60 + dco)) + 
         3 √(297777 + 
             3 dco (143320 + dco (24722 + dco (1160 + 19 dco)))))^(1/3)) + 
    1/60 (-6560 - dco (1371 + dco (60 + dco)) + 
       3 √(297777 + 
           3 dco (143320 + dco (24722 + dco (1160 + 19 dco)))))^(1/3)}, {x -> 
   1/30 (-10 + 
       dco) - (I (-I + Sqrt[3]) (343 + dco (40 + dco)))/(120 (-6560 - 
         dco (1371 + dco (60 + dco)) + 
         3 √(297777 + 
             3 dco (143320 + dco (24722 + dco (1160 + 19 dco)))))^(1/3)) + 
    1/120 I (I + Sqrt[3]) (-6560 - dco (1371 + dco (60 + dco)) + 
       3 √(297777 + 
           3 dco (143320 + dco (24722 + dco (1160 + 19 dco)))))^(1/3)}, {x -> 
   1/30 (-10 + 
       dco) + (I (I + Sqrt[3]) (343 + dco (40 + dco)))/(120 (-6560 - 
         dco (1371 + dco (60 + dco)) + 
         3 √(297777 + 
             3 dco (143320 + dco (24722 + dco (1160 + 19 dco)))))^(1/3)) + 
    1/120 (-1 - I Sqrt[3]) (-6560 - dco (1371 + dco (60 + dco)) + 
       3 √(297777 + 
           3 dco (143320 + dco (24722 + dco (1160 + 19 dco)))))^(1/3)}} *)

If you use Evaluate (Attributes of Plot include HoldAll) you will see that the curve is composed of segments from each of the three roots. No single function can represent the curve since the curve is not single-valued for all values of dco.

Plot[Evaluate@(x /. sol), {dco, -40, 0},
 PlotStyle -> (Directive[Thick, ColorData[97][#]] & /@ {1, 3, 2}),
 PlotLegends -> Placed[Automatic, {0.5, 0.625}]]

enter image description here

If you want only real expressions, then the roots will be ConditionalExpressions and be expressed in the form of Root objects.

(solr = Solve[{(2 x + 2) ((dco - wn aap x)^2 + 1) + 4*ome*x == 0}, x, 
    Reals] // Simplify) // Short[#, 5] &

enter image description here

Plot[Evaluate@(x /. solr), {dco, -40, 0},
 WorkingPrecision -> 15,
 MaxRecursion -> 10,
 PlotStyle -> (Directive[Thick, ColorData[97][#]] & /@ {1, 3, 2}),
 PlotLegends -> Placed[Automatic, {0.5, 0.625}]]

enter image description here

$\endgroup$
  • $\begingroup$ Thankyou very much. $\endgroup$ – vijay Feb 6 at 5:01

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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