-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBlockwise_Smooth_Functions_SDP.nb
More file actions
163 lines (163 loc) · 14.2 KB
/
Blockwise_Smooth_Functions_SDP.nb
File metadata and controls
163 lines (163 loc) · 14.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
Notebook[{Cell[
BoxData[RowBox[{"(*","\[IndentingNewLine]",RowBox[{RowBox[{"In"," ","this"," ","notebook"}],","," ",RowBox[
{RowBox[{"we"," ","show"," ","how"," ","to"," ","express"," ","0"}],">=",RowBox[{RowBox[
{RowBox[{"(",RowBox[{"1","-","\[Lambda]"}],")"}],"A"}],"+",RowBox[{"\[Lambda]"," ","B"}]," ","+",RowBox[
{RowBox[{"(",RowBox[{"1","-","\[Lambda]"}],")"}],"\[Lambda]"," ","C"}]}]}],","," ",RowBox[
{RowBox[{RowBox[{"for"," ","all"," ","0"}],"<=","\[Lambda]","<=",RowBox[{RowBox[{"1","\n","as"," ","a"," ","semi"}],"-",RowBox[
{"definite"," ",RowBox[{"program",".","\n","\n","Letting"}]," ","\n","A"}]}]}],"=",RowBox[
{RowBox[{RowBox[{"-","fi"}],"+","fj","+",RowBox[{"gj","*",RowBox[{"(",RowBox[{"xi","-","xj"}],")"}]}],"+",RowBox[
{RowBox[{RowBox[{RowBox[{RowBox[{"(",RowBox[{RowBox[{"gi","^",RowBox[{"(","m",")"}]}],"-",RowBox[
{"gj","^",RowBox[{"(","m",")"}]}]}],")"}],"^","2"}],"/","2"}],"/","Lm"}]," ","\n","B"}]}],"="," ",RowBox[
{RowBox[{RowBox[{"-","fi"}],"+","fk","+",RowBox[{"gk","*",RowBox[{"(",RowBox[{"xi","-","xk"}],")"}]}],"+",RowBox[
{RowBox[{RowBox[{RowBox[{RowBox[{"(",RowBox[{RowBox[{"gi","^",RowBox[{"(","m",")"}]}],"-",RowBox[
{"gk","^",RowBox[{"(","m",")"}]}]}],")"}],"^","2"}],"/","2"}],"/","Lm"}],"\n","C"}]}],"="," ",RowBox[
{RowBox[{"max_l"," ",RowBox[{RowBox[{RowBox[{RowBox[{"(",RowBox[{RowBox[{"gi","^",RowBox[
{"(","l",")"}]}],"-",RowBox[{"gj","^",RowBox[{"(","l",")"}]}]}],")"}],"^","2"}],"/","2"}],"/","Ll"}]}],"-",RowBox[
{RowBox[{RowBox[{RowBox[{RowBox[{"(",RowBox[{RowBox[{"gi","^",RowBox[{"(","m",")"}]}],"-",RowBox[
{"gj","^",RowBox[{"(","m",")"}]}]}],")"}],"^","2"}],"/","2"}],"/","Lm"}],"\n","allows"," ","conducting"," ","the"," ","proof"," ","of"," ","Proposition"," ","3.9"," ",RowBox[
{"in","\[IndentingNewLine]","[","1","]"}]," ","Rubbens"}]}]}]}]}],","," ","Anne",","," ","Hendrickx",","," ",RowBox[
{"Julien"," ",RowBox[{"M","."}]}],","," ",RowBox[{"and"," ","Taylor"}],","," ",RowBox[
{"Adrien"," ",RowBox[{"B","."," ","\"a constructive approach to strengthen algebraic descriptions of function and operator classes.\""}]}]}],"\[IndentingNewLine]","*)"}]],
"Input",ExpressionUUID -> "05adbc86-c23e-4d62-b0e2-c266e5cdac32"],Cell[
"\< \>","Text",
CellFrame -> {{0,0},{0,0.5`}},CellFrameMargins -> 0,Selectable -> False,ShowCellBracket -> False,
CellFrameColor -> RGBColor[0,0,1],Editable -> False,CellSize -> {Inherited,3},ExpressionUUID -> "916a7bf8-af54-4a39-a110-50347729d251",
CellMargins -> {{0,0},{1,1}},CellElementSpacings -> {"CellMinHeight" -> 1}],Cell[
CellGroupData[
{Cell[
BoxData[{RowBox[{"ClearAll","[","\"Global`*\"","]"}],"\n",RowBox[{RowBox[{"myexpr","=",RowBox[
{RowBox[{RowBox[{"(",RowBox[{"1","-","\[Lambda]"}],")"}],"A"}],"+",RowBox[{"\[Lambda]"," ","B"}],"+",RowBox[
{"\[Lambda]",RowBox[{"(",RowBox[{"1","-","\[Lambda]"}],")"}],"C"}]}]}],";"}],"\n",RowBox[
{RowBox[{RowBox[{"(*",RowBox[{RowBox[{"Obtain"," ","coefficients"," ","\[Lambda]0"}],","," ","\[Lambda]1",",",RowBox[
{RowBox[{"\[Lambda]2"," ","such"," ","that"," ","myexpr"}],"=",RowBox[{"\[Lambda]0","+",RowBox[
{"\[Lambda]1"," ","\[Lambda]"}],"+",RowBox[{"\[Lambda]2"," ",RowBox[{"\[Lambda]","^","2"}]}]}]}]}],"*)"}],"\n","coef\[Lambda]1"}],"=",RowBox[
{RowBox[{"Coefficient","[",RowBox[{"myexpr",",","\[Lambda]"}],"]"}],"//","FullSimplify"}]}],"\n",RowBox[
{"coef\[Lambda]2","=",RowBox[{RowBox[{"Coefficient","[",RowBox[{"myexpr",",",RowBox[
{"\[Lambda]","^","2"}]}],"]"}],"//","FullSimplify"}]}],"\n",RowBox[{RowBox[{RowBox[
{"coef\[Lambda]3","=",RowBox[{RowBox[{"Coefficient","[",RowBox[{"myexpr",",",RowBox[
{"\[Lambda]","^","3"}]}],"]"}],"//","FullSimplify"}]}],";"}]," ",RowBox[{"(*"," ",RowBox[
{"Verify"," ","myexpr"," ","is"," ","a"," ","polynomial"," ","of"," ","degree"," ","2"}],"*)"}]}],"\n",RowBox[
{"coef\[Lambda]0","="," ",RowBox[{RowBox[{"myexpr","-",RowBox[{"\[Lambda]"," ","coef\[Lambda]1"}],"-",RowBox[
{RowBox[{"\[Lambda]","^","2"}]," ","coef\[Lambda]2"}]}],"//","FullSimplify"}]}],"\n",RowBox[
{"MyCheck","="," ",RowBox[{RowBox[{"myexpr","-","coef\[Lambda]0","-",RowBox[{"\[Lambda]"," ","coef\[Lambda]1"}],"-",RowBox[
{RowBox[{"\[Lambda]","^","2"}]," ","coef\[Lambda]2"}]}],"//","FullSimplify"}]}]}],
"Input",CellChangeTimes -> {3950951544.718074`},CellLabel -> "In[121]:= ",ExpressionUUID -> "068dbd5e-d013-4f52-a727-42cdab1c58c9"],Cell[
BoxData[
RowBox[{RowBox[{"-","A"}],"+","B","+","C"}],StandardForm],"Output",CellLabel -> "Out[123]= ",
ExpressionUUID -> "44867837-1cb7-48cd-925b-4ce45f6ca6b1"],Cell[
BoxData[RowBox[{"-","C"}],
StandardForm],"Output",CellLabel -> "Out[124]= ",ExpressionUUID -> "b3cd8983-4ad1-4c37-88f0-28a9e9aeb884"],Cell[
BoxData[
"A",StandardForm],"Output",CellLabel -> "Out[126]= ",ExpressionUUID -> "915e1124-ce54-4246-8ef6-a18b5e811cda"],Cell[
BoxData[
"0",StandardForm],"Output",CellLabel -> "Out[127]= ",ExpressionUUID -> "aefc5285-c8fb-4c9b-a6e2-59bc683f3654"]},
Open],ExpressionUUID -> "641b838e-8ab8-43b3-8adc-c33f03f343ca"],Cell[
"\< \>","Text",
CellFrame -> {{0,0},{0,0.5`}},CellFrameMargins -> 0,Selectable -> False,ShowCellBracket -> False,
CellFrameColor -> RGBColor[0,0,1],Editable -> False,CellSize -> {Inherited,3},ExpressionUUID -> "615b300f-abc5-43b3-93ee-e870bc8440d2",
CellMargins -> {{0,0},{1,1}},CellElementSpacings -> {"CellMinHeight" -> 1}],Cell[
BoxData[
RowBox[{RowBox[{RowBox[{RowBox[{RowBox[{RowBox[{RowBox[{"(*"," ",RowBox[{RowBox[{RowBox[
{"Change"," ","of"," ",RowBox[{"variables",":","\[Lambda]"}]}],"\[Rule]",RowBox[{RowBox[
{"\[Theta]","^","2"}],"/",RowBox[{"(",RowBox[{"1","+",RowBox[{"\[Theta]","^","2"}]}],")"}]}]}],","," ",RowBox[
{RowBox[{"to"," ","go"," ","from"," ","enforcing"," ","\n","\n","myexpr"," ","is"," ","negative"," ","forall"," ","\[Lambda]"," ",RowBox[
{"in"," ","[",RowBox[{"0",",","1"}],"]"}]," ","to"," ","enforcing","\[IndentingNewLine]","\[IndentingNewLine]","P",RowBox[
{"(","\[Theta]",")"}]}],"=",RowBox[{RowBox[{RowBox[{"(",RowBox[{"1","+",RowBox[{"\[Theta]","^","2"}]}],")"}],"^","2"}],RowBox[
{"(",RowBox[{"\[Lambda]0"," ","+"," "}]}]}]}]}]}],FractionBox[RowBox[{"\[Theta]","^","2"}],
RowBox[{"(",RowBox[{"1","+",RowBox[{"\[Theta]","^","2"}]}],")"}]]," ",RowBox[{"(",RowBox[
{"\[Lambda]1"," ","+"," ",RowBox[{FractionBox[RowBox[{"\[Theta]","^","4"}],RowBox[
{RowBox[{"(",RowBox[{"1","+",RowBox[{"\[Theta]","^","2"}]}],")"}],"^","2"}]]," ","\[Lambda]2"}]}],")"}]}]," ","<="," ",RowBox[
{RowBox[{"0"," ","for"," ","all"," ",RowBox[{"\[Theta]","\\","in","\\",RowBox[{"R","."," ","\[IndentingNewLine]","That"}]}]," ","is"," ","enforcing"}]," ","-",RowBox[
{"P",RowBox[{"(","\[Theta]",")"}]," ","to"," ","be"," ","Sum"," ","of"," ","squares"}]}]}],","," ",RowBox[
{"hence"," ","verifying"," ","if"," ","P",RowBox[{"(","\[Theta]",")"}]," ","can"," ","be"," ","written"," ","as"}]}],"\n",RowBox[
{RowBox[{"P",RowBox[{"(","\[Theta]",")"}],RowBox[{RowBox[{"=[","1,\[Theta],\[Theta]^2","]"}],"^","T"}]," ",RowBox[
{"S"," ","[",RowBox[{"1",",","\[Theta]",",",RowBox[{"\[Theta]","^","2"}]}],"]"}]," ","with"," ","S"}]," ","<="," ",RowBox[
{RowBox[{"(","PSD",")"}],"."}]}]}],"*)"}],"\n"}]],"Input",ExpressionUUID -> "b730fc2d-6b15-488a-aac0-e4e946137a71"],Cell[
CellGroupData[
{Cell[
BoxData[{RowBox[{RowBox[{RowBox[{"myexpr1","="," ",RowBox[{"A0","+",RowBox[
{"A1"," ","\[Lambda]"}]," ","+",RowBox[{"A2"," ",RowBox[{"\[Lambda]","^","2"}]}]}]}]," ",";"}]," ",RowBox[
{"(*",RowBox[{"Generic"," ","coefficients"," ","to"," ","simplify"," ","expressions"}],"*)"}]}],"\n",RowBox[
{RowBox[{"myexpr2","=",RowBox[{RowBox[{"myexpr1","//.",RowBox[{"{",RowBox[{"\[Lambda]","\[Rule]"," ",RowBox[
{RowBox[{"\[Theta]","^","2"}],"/",RowBox[{"(",RowBox[{"1","+",RowBox[{"\[Theta]","^","2"}]}],")"}]}]}],"}"}]}],"//","FullSimplify"}]}]," ",";"}],"\n",RowBox[
{RowBox[{"myPol","=",RowBox[{RowBox[{RowBox[{RowBox[{"(",RowBox[{"1","+",RowBox[{"\[Theta]","^","2"}]}],")"}],"^","2"}],"*","myexpr2"}],"//","FullSimplify"}]}],";"}],"\n",RowBox[
{RowBox[{RowBox[{"myMonomials","=",RowBox[{"{",RowBox[{"1",",","\[Theta]",",",RowBox[
{"\[Theta]","^","2"}]}],"}"}]}],";"}],"\[IndentingNewLine]",RowBox[{RowBox[{"myMatrix","=",RowBox[
{"{",RowBox[{RowBox[{"{",RowBox[{"s11",",","s12",",","s13"}],"}"}],",",RowBox[{"{",RowBox[
{"s12",",","s22",",","s23"}],"}"}],",",RowBox[{"{",RowBox[{"s13",",","s23",",","s33"}],"}"}]}],"}"}]}],";"}]}],"\n",RowBox[
{RowBox[{RowBox[{"myMatrix","//","MatrixForm"}],";"}],"\[IndentingNewLine]",RowBox[
{"myReferencePol","=",RowBox[{RowBox[{"myMonomials",".","myMatrix",".","myMonomials"}],"//","Expand"}]}]}]}],
"Input",CellLabel -> "In[142]:= ",ExpressionUUID -> "2029cc21-0f43-410e-9add-b87fbbc1c2d4"],Cell[
BoxData[
RowBox[{"s11","+",RowBox[{"2"," ","s12"," ","\[Theta]"}],"+",RowBox[{"2"," ","s13"," ",SuperscriptBox[
"\[Theta]","2"]}],"+",RowBox[{"s22"," ",SuperscriptBox["\[Theta]","2"]}],"+",RowBox[
{"2"," ","s23"," ",SuperscriptBox["\[Theta]","3"]}],"+",RowBox[{"s33"," ",SuperscriptBox[
"\[Theta]","4"]}]}],StandardForm],"Output",CellLabel -> "Out[148]= ",ExpressionUUID -> "c0a57af8-1ebf-461f-b09d-d1176b72bc4b"]},
Open],ExpressionUUID -> "6f2b681e-be27-4e05-9a2f-e0861ee0bdb1"],Cell[
CellGroupData[
{Cell[
BoxData[{RowBox[{RowBox[{RowBox[{RowBox[{"(*",RowBox[{"Constraints"," ","to"," ","impose"," ","on"," ","S"," ","so"," ","that"," ","P",RowBox[
{"(","\[Theta]",")"}],RowBox[{RowBox[{"=[",RowBox[{"1",",","\[Theta]",",",RowBox[
{"\[Theta]","^","2"}]}],"]"}],"^","T"}]," ",RowBox[{"S"," ","[",RowBox[{"1",",","\[Theta]",",",RowBox[
{"\[Theta]","^","2"}]}],"]"}]}],"*)"}]," ","\n",RowBox[{"constraint","[","0","]"}]}],"=",RowBox[
{RowBox[{"A0","-","s11"}],"//","FullSimplify"}]}],"\[IndentingNewLine]",RowBox[{RowBox[
{RowBox[{"constraint","[","k_","]"}],":=",RowBox[{RowBox[{RowBox[{"Coefficient","[",RowBox[
{"myPol",",",RowBox[{"\[Theta]","^","k"}]}],"]"}],"-",RowBox[{"Coefficient","[",RowBox[
{"myReferencePol",",",RowBox[{"\[Theta]","^","k"}]}],"]"}]}],"//","FullSimplify"}]}],";"}]}],"\n",RowBox[
{RowBox[{"constraint","[","1","]"}],"//","FullSimplify"}],"\n",RowBox[{RowBox[{"constraint","[","2","]"}],"//","FullSimplify"}],"\n",RowBox[
{RowBox[{"constraint","[","3","]"}],"//","FullSimplify"}],"\n",RowBox[{RowBox[{"constraint","[","4","]"}],"//","FullSimplify"}],"\n",RowBox[
{"Checkt","=",RowBox[{RowBox[{RowBox[{"Sum","[",RowBox[{RowBox[{RowBox[{"constraint","[","k","]"}],"*",RowBox[
{"\[Theta]","^","k"}]}],",",RowBox[{"{",RowBox[{"k",",","1",",","4"}],"}"}]}],"]"}],"+",RowBox[
{"constraint","[","0","]"}]," ","-",RowBox[{"(",RowBox[{"myPol","-","myReferencePol"}],")"}]}],"//","FullSimplify"}]}]}],
"Input",CellLabel -> "In[149]:= ",ExpressionUUID -> "8883c0e0-8d48-43fe-b7b4-d5aca5db9c74"],Cell[
BoxData[
RowBox[{"A0","-","s11"}],StandardForm],"Output",CellLabel -> "Out[149]= ",ExpressionUUID -> "0bd04d89-57ce-435a-884b-b3c6b81b491a"],Cell[
BoxData[
RowBox[{RowBox[{"-","2"}]," ","s12"}],StandardForm],"Output",CellLabel -> "Out[151]= ",
ExpressionUUID -> "708e318c-6d35-4de5-9487-a16fd79d9a58"],Cell[
BoxData[RowBox[{RowBox[
{"2"," ","A0"}],"+","A1","-",RowBox[{"2"," ","s13"}],"-","s22"}],StandardForm],"Output",
CellLabel -> "Out[152]= ",ExpressionUUID -> "ab6b9c9b-c87d-4771-8162-898fab49ab04"],Cell[
BoxData[
RowBox[{RowBox[{"-","2"}]," ","s23"}],StandardForm],"Output",CellLabel -> "Out[153]= ",
ExpressionUUID -> "ea903940-89e4-4603-a2ca-12e3147dcc2e"],Cell[
BoxData[RowBox[{"A0","+","A1","+","A2","-","s33"}],
StandardForm],"Output",CellLabel -> "Out[154]= ",ExpressionUUID -> "6cd6481f-b532-47dc-8591-3415ffd17a4e"],Cell[
BoxData[
"0",StandardForm],"Output",CellLabel -> "Out[155]= ",ExpressionUUID -> "7ad03790-074a-4e34-8159-5f8b41952402"]},
Open],ExpressionUUID -> "57a538d7-924b-4c24-8188-5c0ac527e0e6"],Cell[
CellGroupData[
{Cell[
BoxData[{RowBox[{RowBox[{RowBox[{"(*",RowBox[{RowBox[{"Obtain"," ","constraints"," ","on"," ","S"," ","as"," ","functions"," ","of"," ","A"}],",","B",",","C"}],"*)"}],"\n","subs"}],"=",RowBox[
{"{",RowBox[{RowBox[{"A0","\[Rule]","coef\[Lambda]0"}],",",RowBox[{"A1","\[Rule]","coef\[Lambda]1"}],",",RowBox[
{"A2","\[Rule]","coef\[Lambda]2"}]}],"}"}]}],"\n",RowBox[{RowBox[{RowBox[{RowBox[
{"constraint","[","0","]"}],"+","s11"}],"//.","subs"}],"//","FullSimplify"," ",RowBox[
{"(*",RowBox[{"s11","="}],"*)"}]}],"\n",RowBox[{RowBox[{RowBox[{RowBox[{"constraint","[","1","]"}],"+",RowBox[
{"2","s12"}]}],"//.","subs"}],"//","FullSimplify",RowBox[{"(*",RowBox[{RowBox[{"2","s12"}],"="}],"*)"}]}],"\n",RowBox[
{RowBox[{RowBox[{RowBox[{"constraint","[","2","]"}],"+","s22","+",RowBox[{"2","s13"}]}],"//.","subs"}],"//","FullSimplify",RowBox[
{"(*",RowBox[{RowBox[{"s22","+",RowBox[{"2","s13"}]}],"="}],"*)"}]}],"\n",RowBox[
{RowBox[{RowBox[{RowBox[{"constraint","[","3","]"}],"+",RowBox[{"2","s23"}]}],"//.","subs"}],"//","FullSimplify"," ",RowBox[
{"(*",RowBox[{RowBox[{"2","s23"}],"="}],"*)"}]}],"\n",RowBox[{RowBox[{RowBox[{RowBox[
{"constraint","[","4","]"}],"+","s33"}],"//.","subs"}],"//","FullSimplify"," ",RowBox[
{"(*",RowBox[{"s33","="}],"*)"}]}]}],"Input",CellLabel -> "In[162]:= ",ExpressionUUID -> "1e6795a5-e9c9-4ba0-a37d-315bb80ed3bc"],Cell[
BoxData[
RowBox[{"{",RowBox[{RowBox[{"A0","\[Rule]","A"}],",",RowBox[{"A1","\[Rule]",RowBox[
{RowBox[{"-","A"}],"+","B","+","C"}]}],",",RowBox[{"A2","\[Rule]",RowBox[{"-","C"}]}]}],"}"}],
StandardForm],"Output",CellLabel -> "Out[162]= ",ExpressionUUID -> "2179c0c3-a4aa-496f-93e3-3f3fc2eef535"],Cell[
BoxData[
"A",StandardForm],"Output",CellLabel -> "Out[163]= ",ExpressionUUID -> "8faca214-07bf-4375-9a31-647d942490c1"],Cell[
BoxData[
"0",StandardForm],"Output",CellLabel -> "Out[164]= ",ExpressionUUID -> "da0109a4-61b5-42af-a596-9e3c57b58533"],Cell[
BoxData[
RowBox[{"A","+","B","+","C"}],StandardForm],"Output",CellLabel -> "Out[165]= ",ExpressionUUID -> "d2d42409-3396-4f07-b664-3cf70d462693"],Cell[
BoxData[
"0",StandardForm],"Output",CellLabel -> "Out[166]= ",ExpressionUUID -> "befbf3ec-47cb-4f47-b76a-eb846a6ab217"],Cell[
BoxData[
"B",StandardForm],"Output",CellLabel -> "Out[167]= ",ExpressionUUID -> "8dbe54af-9903-475d-836c-dec9703a7b73"]},
Open],ExpressionUUID -> "8f520639-c553-4a99-8ddc-3e58ff687ac2"],Cell[
"\< \>","Text",
CellFrame -> {{0,0},{0,0.5`}},CellFrameMargins -> 0,Selectable -> False,ShowCellBracket -> False,
CellFrameColor -> RGBColor[0,0,1],Editable -> False,CellSize -> {Inherited,3},ExpressionUUID -> "e9e8e239-a3f0-447b-9869-19f8ef274f58",
CellMargins -> {{0,0},{1,1}},CellElementSpacings -> {"CellMinHeight" -> 1}]},StyleDefinitions -> "Default.nb",
WindowSize -> {1387.5`,762},WindowMargins -> {{Automatic,0},{0,Automatic}},FrontEndVersion -> "14.2 for Wolfram Cloud 1.70.1 (December 30, 2024)",
ExpressionUUID -> "8206d6a0-cd18-4230-bc0e-0043ebeaf20e"]