Qurak

Hybrid dynamical systems

ఉదాహరణ 4 దశలు, ఒకే సెషన్‌లో క్రమంగా నడుస్తాయి. ప్రతి దశా ఇంజిన్‌పై అమలు చేయబడింది, కింది అవుట్‌పుట్ అది ఇచ్చినదే.

దశ 1
de[δ_] := {Subscript[x, 1]'[t] == Subscript[x, 2][t], Subscript[x, 2]'[t] == -Subscript[x, 1][t] + 2δ Subscript[x, 2][t] + 1};
ic = {Subscript[x, 1][0] == .5, Subscript[x, 2][0] == .5};
sol = NDSolve[{de[0.1], ic, WhenEvent[And[Subscript[x, 2][t] == 0, Subscript[x, 1][t] < 0], {Subscript[x, 1][t] -> -Subscript[x, 1][t]}]}, {Subscript[x, 1], Subscript[x, 2]}, {t, 0, 500}];

అవుట్‌పుట్ లేదు - ఈ దశ తదుపరి దానికి ఏదో సిద్ధం చేస్తుంది.

దశ 2
Row[Map[ParametricPlot[{Subscript[x, 1][t], Subscript[x, 2][t]} /. sol, {t, 0, #}, PlotPoints -> 500, PlotRange -> {{-1, 2.5}, {-2, 1.5}}]&, {10, 50, 150}]]
అవుట్‌పుట్
-Graphics--Graphics--Graphics-
దశ 3
resetOsc[δ_] := NDSolve[{de[δ], ic, WhenEvent[And[Subscript[x, 2][t] == 0, Subscript[x, 1][t] < 0], {Subscript[x, 1][t] -> -Subscript[x, 1][t]}]}, {Subscript[x, 1], Subscript[x, 2]}, {t, 0, 500}];
{sol1, sol2, sol3} = Map[resetOsc, {.1, .15, .2}];

అవుట్‌పుట్ లేదు - ఈ దశ తదుపరి దానికి ఏదో సిద్ధం చేస్తుంది.

దశ 4
Grid[{Map[ParametricPlot[{Subscript[x, 1][t], Subscript[x, 2][t]} /. sol1, {t, 0, #}, PlotPoints -> 500, PlotRange -> {{-3, 3}, {-3, 3}}]&, {10, 50, 150}],
	Map[ParametricPlot[{Subscript[x, 1][t], Subscript[x, 2][t]} /. sol2, {t, 0, #}, PlotPoints -> 500, PlotRange -> {{-3, 3}, {-3, 3}}, PlotStyle -> Green]&, {10, 50, 150}], Map[ParametricPlot[{Subscript[x, 1][t], Subscript[x, 2][t]} /. sol3, {t, 0, #}, PlotPoints -> 500, PlotRange -> {{-3, 3}, {-3, 3}}, PlotStyle -> Red]&, {10, 50, 150}]}]
అవుట్‌పుట్
Grid[{{-Graphics-, -Graphics-, -Graphics-}, {-Graphics-, -Graphics-, -Graphics-}, {-Graphics-, -Graphics-, -Graphics-}}]

వాడిన ఫంక్షన్లు

సంబంధిత రెసిపీలు

అన్ని రెసిపీలు · ఫంక్షన్ రిఫరెన్స్ · దీన్ని MCP క్లయింట్ నుండి వాడండి