Skip to content

Commit 5ddcab1

Browse files
authored
Merge pull request #1 from johanneslatzel/main
Rework of repository
2 parents c04eb14 + ccb66fd commit 5ddcab1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+163717
-156981
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vscode

Julia Exercises/01_Ex4b.ipynb

Lines changed: 112 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
{
44
"cell_type": "code",
55
"execution_count": null,
6+
"id": "cdc2b6fb",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"using Pkg\n",
11+
"Pkg.activate(joinpath(dirname(pwd()), \"conf\", \"01_Ex4b\"))\n",
12+
"Pkg.instantiate();"
13+
]
14+
},
15+
{
16+
"cell_type": "code",
17+
"execution_count": 3,
618
"id": "42be4586",
719
"metadata": {},
820
"outputs": [],
@@ -12,12 +24,25 @@
1224
},
1325
{
1426
"cell_type": "code",
15-
"execution_count": null,
27+
"execution_count": 4,
1628
"id": "cc1ff067",
1729
"metadata": {
1830
"scrolled": false
1931
},
20-
"outputs": [],
32+
"outputs": [
33+
{
34+
"data": {
35+
"text/plain": [
36+
"3×2 Matrix{Float64}:\n",
37+
" 1.0 -0.5\n",
38+
" 0.0 0.0\n",
39+
" -2.0 1.0"
40+
]
41+
},
42+
"metadata": {},
43+
"output_type": "display_data"
44+
}
45+
],
2146
"source": [
2247
"A = [1 -1/2; 0 0; -2 1]"
2348
]
@@ -32,17 +57,40 @@
3257
},
3358
{
3459
"cell_type": "code",
35-
"execution_count": null,
60+
"execution_count": 5,
3661
"id": "938a0cfb",
3762
"metadata": {},
38-
"outputs": [],
63+
"outputs": [
64+
{
65+
"data": {
66+
"text/plain": [
67+
"SVD{Float64, Float64, Matrix{Float64}, Vector{Float64}}\n",
68+
"U factor:\n",
69+
"3×2 Matrix{Float64}:\n",
70+
" -0.447214 -0.894427\n",
71+
" 0.0 0.0\n",
72+
" 0.894427 -0.447214\n",
73+
"singular values:\n",
74+
"2-element Vector{Float64}:\n",
75+
" 2.5000000000000004\n",
76+
" 9.930136612989092e-17\n",
77+
"Vt factor:\n",
78+
"2×2 Matrix{Float64}:\n",
79+
" -0.894427 0.447214\n",
80+
" -0.447214 -0.894427"
81+
]
82+
},
83+
"metadata": {},
84+
"output_type": "display_data"
85+
}
86+
],
3987
"source": [
4088
"(U,S,Vt) = svd(A)"
4189
]
4290
},
4391
{
4492
"cell_type": "code",
45-
"execution_count": null,
93+
"execution_count": 6,
4694
"id": "6ecb1c61",
4795
"metadata": {},
4896
"outputs": [],
@@ -54,20 +102,44 @@
54102
},
55103
{
56104
"cell_type": "code",
57-
"execution_count": null,
105+
"execution_count": 7,
58106
"id": "da17abd5",
59107
"metadata": {},
60-
"outputs": [],
108+
"outputs": [
109+
{
110+
"data": {
111+
"text/plain": [
112+
"2×3 Matrix{Float64}:\n",
113+
" 0.16 0.0 -0.32\n",
114+
" -0.08 0.0 0.16"
115+
]
116+
},
117+
"metadata": {},
118+
"output_type": "display_data"
119+
}
120+
],
61121
"source": [
62122
"pinvA = pinv(A)"
63123
]
64124
},
65125
{
66126
"cell_type": "code",
67-
"execution_count": null,
127+
"execution_count": 8,
68128
"id": "f5df81eb",
69129
"metadata": {},
70-
"outputs": [],
130+
"outputs": [
131+
{
132+
"data": {
133+
"text/plain": [
134+
"2×3 Matrix{Float64}:\n",
135+
" -4.02814e15 0.0 -2.01407e15\n",
136+
" 8.05628e15 0.0 4.02814e15"
137+
]
138+
},
139+
"metadata": {},
140+
"output_type": "display_data"
141+
}
142+
],
71143
"source": [
72144
"bad_pinvA = V * Σ^(-1) * Ut"
73145
]
@@ -82,36 +154,60 @@
82154
},
83155
{
84156
"cell_type": "code",
85-
"execution_count": null,
157+
"execution_count": 9,
86158
"id": "b6a999b1",
87159
"metadata": {},
88-
"outputs": [],
160+
"outputs": [
161+
{
162+
"data": {
163+
"text/plain": [
164+
"2×3 Matrix{Float64}:\n",
165+
" 0.16 0.0 -0.32\n",
166+
" -0.08 0.0 0.16"
167+
]
168+
},
169+
"metadata": {},
170+
"output_type": "display_data"
171+
}
172+
],
89173
"source": [
90174
"pinv(A, rtol=1e-16)"
91175
]
92176
},
93177
{
94178
"cell_type": "code",
95-
"execution_count": null,
179+
"execution_count": 10,
96180
"id": "811e8e05",
97181
"metadata": {},
98-
"outputs": [],
182+
"outputs": [
183+
{
184+
"data": {
185+
"text/plain": [
186+
"2×3 Matrix{Float64}:\n",
187+
" 4.02814e15 0.0 2.01407e15\n",
188+
" 8.05628e15 0.0 4.02814e15"
189+
]
190+
},
191+
"metadata": {},
192+
"output_type": "display_data"
193+
}
194+
],
99195
"source": [
100196
"pinv(A, rtol=1e-17)"
101197
]
102198
}
103199
],
104200
"metadata": {
105201
"kernelspec": {
106-
"display_name": "Julia 1.7.2",
202+
"display_name": "Julia 1.11.4",
107203
"language": "julia",
108-
"name": "julia-1.7"
204+
"name": "julia-1.11"
109205
},
110206
"language_info": {
111207
"file_extension": ".jl",
112208
"mimetype": "application/julia",
113209
"name": "julia",
114-
"version": "1.7.2"
210+
"version": "1.11.4"
115211
}
116212
},
117213
"nbformat": 4,

Julia Exercises/02_Ex4.ipynb

Lines changed: 2223 additions & 18 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)