Using the same concept discussed in Plotting minima of a mutivariable function, I am trying to plot the minimas for the function z[v_, t_]
here.
This is what I am trying to do:
e = 1;
f = 1/2;
c = Sqrt[e^2+f];
d = Sqrt[e^2-f];
a[t_] := (1/2)*(I*c*Cot[c*t]- c^2/(e*(Sin[c*t])^2 - I*c*Cos[c*t]Sin[c*t]));
b[t_] := (1/2)*(I*d*Cot[d*t]- d^2/(e*(Sin[d*t])^2 - I*d*Cos[d*t]Sin[d*t]));
g[t_] := -(a[t]+b[t]);
h[t_] := a[t]-b[t];
u[t_] := -Re[a[t]+b[t]];
w[v_,t_] := u[t] + I*v;
x[v_,t_] := (1/2)*(g[t]+w[v,t]+Sqrt[(g[t]-w[v,t])^2 + 4h[t]^2]);
y[v_,t_] := (1/2)*(g[t]+w[v,t]-Sqrt[(g[t]-w[v,t])^2 + 4h[t]^2]);
z[v_,t_] := (1/2)**Sqrt[(Log[Abs[x[v,t]]])^2 +(ArcTan[Im[x[v,t]]]/Re[x[v,t]])^2 + (Log[Abs[y[v,t]]])^2 +(ArcTan[Im[y[v,t]]]/Re[y[v,t]])^2];
I tried plotting two ways.
reg = ParametricRegion[{{t, z[v, t]}, {D[z[v, t], v] == 0,
D[z[v, t], {v, 2}] >= 0, -10 <= t <= 10}}, {v, t}];
Region[Style[reg, Red], Axes -> True, AspectRatio -> 1]
min = Minimize[{z[v,t], t == j}, {v, t}][[2]];
p = {t, z[v,t]} /. min
ParametricPlot[p, {j, -10, 10}, AspectRatio -> 1]
With the first method, I am not getting errors but the plot doesn't appear. With the 2nd method, I am facing errors like ReplaceAll:{min} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
and issues related cloud:timelimit
of my basic plan.
What are causing the issues and how to fix them?
Minimize
finds exact solutions; best to use exact input; replace0.5
with1/2
everywhere. 2) Check the return value ofMinimize
before applying[[2]]
; you want to be sure what second part you are extracting. -- Other problems:Abs
,Re
, andIm
are not differentiable functions. The derivative ofz[v, t]
will have undefined terms. It's probably why the first region doesn't work. $\endgroup$