TransWikia.com

Plotting in for loop

Mathematica Asked on May 17, 2021

I am having some problem while plotting the data being generated in for loop
My aim is to plot the result of for loop while it is solving the equation for each value of w,i.e. plot between w and x

Here is the minimum working example

For[w = 0.9925, w < 1.0075, w += 0.0015, 
    Plot[Solve[{x^6 + x^4 + w*x^2 == 0 , x > 0}, x, Reals], {w}]
]

One Answer

ContourPlot has a bug! It missing some curves , for example the x=0 !

 ContourPlot[x^6 + x^4 + w*x^2 == 0, {w, -10, 10}, {x, -10, 10}, 
     PlotPoints -> 50, ContourStyle -> Red, FrameLabel -> {w, x}, 
     LabelStyle -> {FontFamily -> "Times", 16, Blue}]

enter image description here

Or

 Clear["`*"];
Solve[x^6 + x^4 + w*x^2 == 0 , x, Method -> Reduce]
Plot[x /. % // Evaluate, {w, -10, 10}, AxesLabel -> {w, x}, 
 LabelStyle -> {FontFamily -> "Times", 12, Blue}, 
 PlotStyle -> {Thickness[0.0125]}]

enter image description here

Answered by cvgmt on May 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP