changes to recursion attempt

temporaryWork
youainti 5 years ago
parent b40a6af274
commit 55f8a0b00d

@ -3,7 +3,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 1, "execution_count": 1,
"id": "linear-harvey", "id": "sustained-board",
"metadata": { "metadata": {
"tags": [] "tags": []
}, },
@ -16,7 +16,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "honey-excuse", "id": "numeric-victoria",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# Setup Functions\n", "# Setup Functions\n",
@ -26,7 +26,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 2,
"id": "helpful-radical", "id": "virtual-arlington",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -57,7 +57,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "fifty-southwest", "id": "wrapped-message",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Setup functions related to the problem" "## Setup functions related to the problem"
@ -66,7 +66,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 3, "execution_count": 3,
"id": "fancy-manual", "id": "neutral-vietnamese",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -82,10 +82,12 @@
" \n", " \n",
" return 1 - ( b*eta*torch.exp(eta+b*stock-eta*torch.exp(b*stock)))\n", " return 1 - ( b*eta*torch.exp(eta+b*stock-eta*torch.exp(b*stock)))\n",
"\n", "\n",
"def test_launch(stock, debris):\n",
" return torch.ones(5, requires_grad=True)\n",
"\n", "\n",
"def laws_of_motion(stock, debris, launches):\n", "def laws_of_motion(stock, debris, launches):\n",
" \n", " \n",
" new_stock = stock*survival(stock,debris) + launches #TODO: Launches will become a function (neural network)\n", " new_stock = stock*survival(stock,debris) + launches(stock,debris) #TODO: Launches will become a function (neural network)\n",
" \n", " \n",
" #TODO: Currently Ignoring autocatalysis\n", " #TODO: Currently Ignoring autocatalysis\n",
" new_debris = (1-DELTA)*debris + LAUNCH_DEBRIS_RATE * launches.sum() + COLLISION_DEBRIS_RATE*(1-survival(stock,debris)) @ stock\n", " new_debris = (1-DELTA)*debris + LAUNCH_DEBRIS_RATE * launches.sum() + COLLISION_DEBRIS_RATE*(1-survival(stock,debris)) @ stock\n",
@ -100,7 +102,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4, "execution_count": 4,
"id": "dietary-vault", "id": "considered-configuration",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -138,7 +140,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "illegal-thriller", "id": "premium-lesbian",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# Actual calculations" "# Actual calculations"
@ -147,7 +149,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 5, "execution_count": 5,
"id": "coated-dressing", "id": "suffering-google",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -179,7 +181,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 10, "execution_count": 10,
"id": "analyzed-transfer", "id": "checked-medication",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -203,7 +205,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "confidential-stadium", "id": "wanted-principal",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Note how this fails on the last few iterations.\n", "Note how this fails on the last few iterations.\n",
@ -218,7 +220,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "cbb2f9e4-2248-467e-b6f9-dd5cdd156ce6", "id": "solid-correlation",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [] "source": []
@ -240,7 +242,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.9.5" "version": "3.8.8"
} }
}, },
"nbformat": 4, "nbformat": 4,

Loading…
Cancel
Save