# How to plot using ListPlot and FindRoot

I am new to Mathematica, now I have an expression Implicit\[Omega]Zero

with some parameters $$\lambda1,\mu rr,\theta s,b0,a,b1,\omega$$

Now I want to find the $$\omega(a)$$ for the solution Implicit\[Omega]Zero==0 for

params = {\[Lambda]1 -> 1, \[Mu]rr -> 0.05, \[Theta]s -> \[Pi]/2,  b0 -> .01, a -> a0, b1 -> .1}


Here is my try:

params = {\[Lambda]1 -> 1, \[Mu]rr -> 0.05, \[Theta]s -> \[Pi]/2,
b0 -> .01, a -> a0, b1 -> .1}
Azero[a0_, \[Omega]_] = Implicit\[Omega]Zero /. params
ListPlot[
Table[{i, FindRoot[Azero[i, \[Omega]] == 0, {\[Omega], 2}]}, {i, 3,
5, 1/2000}]]


Here I know the zero will be around 2. But it didn't work, I want to get a plot of $$\omega(a)$$,any suggestion will be appreciated.

If you need what is Implicit\[Omega]Zero:

B[\[Theta]_] = (b0 b1 E^((\[Theta] \[Lambda]1)/\[Omega]))/(
b1 E^((\[Pi] \[Lambda]1)/(4 \[Omega])) +
b0 (-E^(((\[Pi] \[Lambda]1)/(4 \[Omega]))) +
E^((\[Theta] \[Lambda]1)/\[Omega])));
Fb = a Integrate[
B[\[Theta]], {\[Theta], \[Theta]s, 2 \[Pi] - \[Theta]s}] //
Simplify
Lb = a^2 Integrate[
Sin[\[Theta]] B[\[Theta]], {\[Theta], \[Theta]s,
2 \[Pi] - \[Theta]s}] // Simplify
Implicit\[Omega]Zero = -(\[Mu]rr \[Omega] + Lb) // Simplify

• What is the definition for Implicit\[Omega]Zero? We need executable code to play with. Oct 24 at 4:31
• @BobHanlon This is a complicate definition, I have posted the code in my question if you need it Oct 24 at 4:48

Clear["Global*"]

B[θ_] = (b0 b1 E^((θ λ1)/ω))/(b1 E^((\
π λ1)/(4 ω)) +
b0 (-E^(((π λ1)/(4 ω))) +
E^((θ λ1)/ω)));

Fb = a Integrate[
B[θ], {θ, θs, 2 π - θs}] //
Simplify;

Lb = a^2 Integrate[
Sin[θ] B[θ], {θ, θs,
2 π - θs}] // Simplify;

ImplicitωZero = -(μrr ω + Lb) // Simplify;

params = {λ1 -> 1, μrr -> 1/20, θs -> π/2,
b0 -> 1/100, a -> a0, b1 -> 1/10};

Azero[a0_, ω_] = ImplicitωZero /. params;

root[i_?NumericQ] :=
ω /.
FindRoot[Azero[i, ω] == 0, {ω, 2},
WorkingPrecision -> 15]


Using ListPlot

data = Table[{i, root[i]}, {i, 3, 5, 1/100}];

ListPlot[data]


Using Plot

Off[FindRoot::precw]

Plot[root[i], {i, 3, 5}]


EDIT: To use Manipulate to vary a parameter, include the parameter as an argument to the functions

params = {μrr -> 1/20, θs -> π/2, b0 -> 1/100, a -> a0,
b1 -> 1/10};

Azero[a0_, ω_, λ1_] = ImplicitωZero /. params;

root[i_?NumericQ, λ1_?NumericQ] := ω /.
FindRoot[Azero[i, ω, λ1] == 0, {ω, 2},
WorkingPrecision -> 15]

Off[FindRoot::precw]

Manipulate[
Plot[root[i, λ1], {i, 3, 5},
PlotRange -> {0, 6}],
{{λ1, 1}, 0.05, 2, 0.05, Appearance -> "Labeled"}]
`

• Thank you! Is there any chance to use Manipulate to get the plots for different parameters (e.g different $\lambda 1$) Oct 25 at 1:05