I am trying to run a simulation of a circuit to observe chaotic behavior, and have obtained a set of differential equations from an analysis of the circuit.
I thought perhaps I could produce a plot of the current j[t]
or generate a parametric plot of j[t]
and the voltage V[t]
. My constants and used functions I used were
A=1;
ϕ=0.0257275275;
ω=151.6*10^3;
Cj=17*10^(-9);
Cs=35*10^(-9);
Rt=223.9;
I0=5*10^-6;
L=15*10^-3;
V0[t_]:=A*Cos[ω*t];
Id[x_]:=I0*(Exp[x/ϕ]-1);
Cd[x_] := Piecewise[
{{Cj/Sqrt[1 - x/ϕ], x < 0},
{Cs*Exp[x/ϕ], x >= 0}}
];
and the differential equations and input I used were,
eqn = {V'[t] == (j[t] - Id[V[t]])/Cd[V[t]], j'[t] == (V0[t] - Rt*j[t] - V[t])/L};
bc = {V[0] == A, j[0] == 0, θ[0] == 0};
pl = NDSolve[{eqn, bc}, j, {t, 0, 1}]
ParametricPlot[Evaluate[j[t] /. pl], {t, 0, 1}, PlotRange -> All]
It would appear however that my method of evaluation is inappropriate as I'm getting an error from NDSolve: The method currently implemented for delay differential equations does not support delays that depend directly on the time variable or dependent variables.
(Resolved)
Is there anyway I can resolve this or perhaps another way to solve the set of differential equations?
Edit: Removed unnecessary third diff. eq. θ'[t]=ω. Unfortunately, it seems to be unable to solve an ordinary differential equation. A research paper on a similar circuit said that the equations could be solved numerically by an explicit fourth-order Runge-Kutta algorithm, so perhaps there's a way I can instruct Mathematica to solve it using this?
Edit 2: RemovedCj/Sqrt[1 - x/ϕ]
from x≥0
for Cd
θ[t]
; why not helpNDSolve[]
out and simplify your DEs? $\endgroup$InputForm
and to check by copying the SE code back into Mathematica and testing it. I edited your Q to fix it, but I had to assume what the piecewise was meant to be. Please check it. $\endgroup$V[ω*t]
, which will require the value ofV
to be known far in advance of the current timet
, in order to compute the value forj'[t]
; further the difference is not fixed, but varies, which is what the error is complaining about. Are you certain about theV[ω*t]
term? $\endgroup$