Skip to main content

plotting - Select one among multiple solutions that satisfies a certain condition and 3D Plot it with varying simulation values



My function is as follows:


$$f(x)=ax^5+bx^4+cx^3+dx^2+ex+g=0$$


Since it does not generate an analytical solution, I tried to do a simulation exercise as follows.


Simulation values: $a=-2$, $b=3$, $c=5$, $g=3.5$.


And for $0\leqslant d\leqslant 1$ and $0\leqslant e\leqslant 1$, among five different solutions, I would like to pick the one that is real and positive, and 3DPlot it against $d$ and $e$.


My Mathematica code is as follows:


Plot3D[x/.sol=Select[{Solve[ax^5+bx^4+cx^3+dx^2+ex+f==0,x]},#>0&,1],{d,0,1},{e,0,1}]

And the result I get is this:


enter image description here



Any help would be greatly appreciated!




Comments