Victor San Gil
Victor San Gil

Reputation: 13

Mathematica Graphing Solutions

I need help with this math problem for mathematica. See attached picture. Math Problem Picture Link

Upvotes: 0

Views: 65

Answers (1)

Chris Degnen
Chris Degnen

Reputation: 8645

Taking cues from the Mathematica Navigator edition 3, chapter 26 Differential Equations, section 26.1.3 Simultaneous Equations, example 1, Basic Techniques.

vars = {x[t], y[t]};

eqns = {
   x'[t] == x[t] - 2 y[t],
   y'[t] == x[t] - y[t]};

(* define a range of initial conditions *)
range = Flatten[Table[{x0, y0}, {x0, 2, 4}, {y0, 0, 1}], 1];

sols = Function[{x0, y0},
    inits = {x[0] == x0, y[0] == y0};
    vars /. First@DSolve[Join[eqns, inits], vars, t]] @@@ range;

ParametricPlot[sols, {t, 0, 2 Pi},
 PlotLegends -> LineLegend["Expressions",
   LegendLabel -> Placed["Parametric Equations", Above],
   LegendFunction -> Framed]]

enter image description here

Upvotes: 2

Related Questions