Plot Options

{x1min,x1max} = {-10,10};
{x2min,x2max} = {-10,10};
{tmin,tmax} = {-100,100};

Input data: feel free to change this section

A0 = {{0,1},{1,1}};
b0 = {0,0};
c0=0;
A1 = {{1,-1},{-1,0}};
b1 = {0,0};
c1 = 1;

Definitions: check that gammamin and gammaplus are defined (this may not be the case if A0 and A1 don’t satisfy the necessary assumptions)

TrA[gamma_] := Tr[A0 + gamma * A1];
DetA[gamma_]:= Det[A0 + gamma * A1];
q0[x1_,x2_] := {x1,x2}.A0.{x1,x2} + 2* b0.{x1,x2}+c0;
q1[x1_,x2_] := {x1,x2}.A1.{x1,x2} + 2* b1.{x1,x2}+c1;
q[gamma_,x1_,x2_]:=q0[x1,x2]+gamma*q1[x1,x2];
qmax[x1_,x2_]:= Max[q[gammamin,x1,x2],q[gammaplus,x1,x2]];
gammamin = Minimize[{gamma,TrA[gamma]≥0&&DetA[gamma]≥0 && gamma≥0},{gamma}][[1]]
gammaplus= Maximize[{gamma,TrA[gamma]≥0&&DetA[gamma]≥0 && gamma≥0},{gamma}][[1]]

Plots

Plot3D[q0[x1,x2],{x1,x1min,x1max},{x2,x2min,x2max},PlotRange->{tmin,tmax},RegionFunction->Function[{x1,x2}, q1[x1,x2]≤0],PlotTheme->"Web",BoxRatios->{1,1,1},ClippingStyle->{Automatic,None},FillingStyle->Opacity[1],PlotStyle->RGBColor[0.26,0.84,0.5]]
Plot3D[q0[x1,x2],{x1,x1min,x1max},{x2,x2min,x2max},PlotRange->{tmin,tmax},RegionFunction->Function[{x1,x2}, q1[x1,x2]≤0],PlotTheme->"Web",BoxRatios->{1,1,1},ClippingStyle->{Automatic,None},FillingStyle->Opacity[1],PlotStyle->RGBColor[0.2,0.5,0.85],Filling->Top]
Plot3D[qmax[x1,x2],{x1,x1min,x1max},{x2,x2min,x2max},PlotRange->{tmin,tmax},PlotTheme->"Web",BoxRatios->{1,1,1},ClippingStyle->{Automatic,None},FillingStyle->Opacity[1],PlotStyle->RGBColor[0.31,0.19,0.76],Filling->Top]
Plot3D[q[gammamin,x1,x2],{x1,x1min,x1max},{x2,x2min,x2max},PlotRange->{tmin,tmax},PlotTheme->"Web",BoxRatios->{1,1,1},ClippingStyle->{Automatic,None},FillingStyle->Opacity[1], PlotStyle->RGBColor[0.93,0.42,0.27],Filling->Top]
Plot3D[q[gammaplus,x1,x2],{x1,x1min,x1max},{x2,x2min,x2max},PlotRange->{tmin,tmax},PlotTheme->"Web",BoxRatios->{1,1,1},ClippingStyle->{Automatic,None},FillingStyle->Opacity[1], PlotStyle->RGBColor[0.93,0.42,0.27],Filling->Top]