Im probably not seeing the obvious question but i want to minimize an expression like:
Func[A_,B_,θ_,θ1_]:= A Cos[θ-θ1] + B Sin[θ]^2
where i do to minimize in order to theta
A=1
B=1
θ1=π
NMinimize[Func[A,B,θ,θ1],{θ}]
which i can get the desired outputs. Now if i want to sweep one of the variables (theta1) i can plot it like
Plot[NMinimize[
Func[A, B, θ, θ1], {θ}][[1]], {θ1, -\
π, π}]
But now i want to find the minimum of this graphic. I cannot do
NMinimize[NMinimize[ Func[A, B, θ, θ1], {θ}][[1]], {θ1}]
one thing i can do it to plot several plots for theta1 values and extract the minimum. But is there anyway to do it automatically?
My end goal is to extract the minimums of the plot of (minimum func in respect of theta) as function of theta1 for several A constants
NMinimize[Func[A, B, \[Theta], \[Theta]2], {\[Theta], \[Theta]2}]
gives{-1., {\[Theta] -> 5.05573*10^-21, \[Theta]2 -> -3.14159}}
. $\endgroup$