Experiments.ipynb 2.46 KB
Newer Older
1
2
3
4
5
6
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
7
    "## MLMC Experiments "
8
9
10
11
12
13
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
niklas.baumgarten's avatar
niklas.baumgarten committed
14
    "### Elliptic PDEs"
15
16
17
18
   ]
  },
  {
   "cell_type": "code",
niklas.baumgarten's avatar
niklas.baumgarten committed
19
   "execution_count": null,
20
21
22
23
24
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "sys.path.append('..')\n",
niklas.baumgarten's avatar
niklas.baumgarten committed
25
    "from python.mlmc_mppy import mlmc_mpp as mpp"
26
27
28
29
30
31
32
33
34
35
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
niklas.baumgarten's avatar
niklas.baumgarten committed
36
37
38
39
40
41
42
43
44
45
    "mpp.clean_build()\n",
    "mpp.kill()\n",
    "mpp.build()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Convergence tests"
46
47
48
49
   ]
  },
  {
   "cell_type": "code",
niklas.baumgarten's avatar
niklas.baumgarten committed
50
   "execution_count": null,
51
   "metadata": {
niklas.baumgarten's avatar
niklas.baumgarten committed
52
    "scrolled": true
53
   },
niklas.baumgarten's avatar
niklas.baumgarten committed
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
   "outputs": [],
   "source": [
    "mpp.run(4, [\"mlmc_elliptic\", \"initLevels=3,4,5\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "mpp.show_convergence_table()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
73
   "source": [
niklas.baumgarten's avatar
niklas.baumgarten committed
74
    "mpp.show_mlmc_table()"
75
76
77
78
79
80
81
82
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
niklas.baumgarten's avatar
niklas.baumgarten committed
83
84
85
86
87
88
    "Experiment = ConvergenceTest\n",
    "initLevels = [3, 4, 5, 6, 7, 8, 9]\n",
    "alphas = [1.0, 1.4, 1.8]\n",
    "sigmas = [1.0, 1.5, 2.0]\n",
    "lambdas = [0.05, 0.10, 0.15]\n",
    "cores = 32"
89
90
91
92
93
94
95
96
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
niklas.baumgarten's avatar
niklas.baumgarten committed
97
    "mpp.run(4, [\"mlmc_elliptic\", \"Experiment=ConvergenceTest\"])"
98
99
100
101
102
103
104
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
niklas.baumgarten's avatar
niklas.baumgarten committed
105
106
107
108
109
110
111
112
113
   "source": [
    "Experiment = MLMCOverEpsilon\n",
    "initLevels = [3, 4, 5]\n",
    "alphas = [1.4, 1.8]\n",
    "sigmas = [1.0]\n",
    "lambdas = [0.15]\n",
    "cores = 32\n",
    "epsilonList = [0.01, 0.005, 0.001]"
   ]
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}