SetDirectory["C:\\drorbn\\AcademicPensieve\\Classes\\12-267"]

RandomQuadratic[] := (a (x^2)+(Sqrt[2])b x y+c (y^2)) /. a|b|c :> RandomVariate[NormalDistribution[]];
RandomQuadratic[n_] := Table[RandomQuadratic[], {n}]

RandomQuadratic[2]

quad=RandomQuadratic[2];
Print[quad];
VectorPlot[quad, {x,-1,1}, {y,-1,1}]

eqns=Join[
Thread[{x'[t], y'[t]} == (quad /. {x->x[t], y->y[t]})],
{x[0]==RandomReal[{-1,1}], y[0]==RandomReal[{-1,1}]}
];
sol=NDSolve[eqns, {x,y}, {t,-1,1}]

ParametricPlot[
Evaluate[{x[t], y[t]} /. sol],
{t,-1,1},
PlotRange -> {{-1,1},{-1,1}}
]

MakeImage["QuadraticPortraits",
GraphicsGrid[Table[
quad=RandomQuadratic[2];
Print[quad];
Show[Join[
{VectorPlot[quad, {x,-1,1}, {y,-1,1}, Frame->None]},
Table[
eqns=Join[
Thread[{x'[t], y'[t]} == (quad /. {x->x[t], y->y[t]})],
{x[0]==RandomReal[{-1,1}], y[0]==RandomReal[{-1,1}]}
];
sol=NDSolve[eqns, {x,y}, {t,-1,1}];
ParametricPlot[
Evaluate[{x[t], y[t]} /. sol],
{t,-1,1},
PlotRange -> {{-1,1},{-1,1}}, ColorFunction -> (Red&)
],
{100}
]
]],
{8}, {8}
]]
]