A simple 3-dimensional ODE system is given:
$F=\begin{cases} \dot{x}=g+g_{U_{rep}} \\ \dot{g}=-g+\frac{df}{dx} \\ \dot{h}=-h+\frac{d^2f}{d^2x} \end{cases} $
Task: Make the variable $g$ move so that it bounces off the barrier $\psi=\delta +\frac{2-\delta }{t T+1}$
where:
$x,g,h$ - state-space variables
$f=-x^2$
$T, \delta$ - positive numbers;
$g_{U_{rep}}=F_{APF}(g)$ - repulsive barrier;
$t$ - time;
I want to use artificial potential barriers that allow ODE variable to avoid obstacles. They are constructed as follows. https://authors.library.caltech.edu/106548/1/2010.09819.pdf
There is my code:
Clear["Derivative"]
ClearAll["Global`*"]
pars = {xs = -1, xe = 1/2, T = 1/2, \[Delta] = 0.35};
f = -(x[t])^2
(***)
\[Psi]obs = (1 - \[Delta])/(T t + 1) + \[Delta]
krep = 1; dobs = 0.25; \[Rho]0 = 0.25;
\[Rho] = Norm[{G[t] - \[Psi]obs}, 2] - dobs
gUrep = Piecewise[{{krep/\[Rho]^2 (1/\[Rho] - 1/\[Rho]0) G[
t]/\[Rho], \[Rho] <= \[Rho]0}, {0, \[Rho] > \[Rho]0}}]
Plot[{\[Psi]obs}, {t, 0, 100}, PlotRange -> Full]
(***)
sys = NDSolve[{x'[t] == G[t] + gUrep, G'[t] + G[t] == D[f, x[t]],
H'[t] + H[t] == D[f, {x[t], 2}], x[0] == xs, G[0] == 0.5,
H[0] == 0}, {x, G, H}, {t, 0, 500},
Method -> {"DiscontinuityProcessing" -> False}]
Plot[{Evaluate[x[t] /. sys], xe}, {t, 0, 100}, PlotRange -> Full,
PlotPoints -> 200]
Plot[{Evaluate[G[t] /. sys], \[Psi]obs}, {t, 0, 100},
PlotRange -> Full, PlotPoints -> 200]
Plot[{Evaluate[gUrep /. sys]}, {t, 0, 4}, PlotRange -> Full,
PlotPoints -> 200]
I want to visualize the movement of a system in a steady-state with barriers and also how a variable pushes against these barriers in this system. I don't know how to correctly express this: vector space visualization, phase-space visualization, etc.
We may need commands: ParametricPlot3D
and ParametricPlot
gUrep
first? $\endgroup$gUrep=0
for `{t,0,500}'. That is the reason to define this function? $\endgroup$