Created
December 27, 2022 21:52
-
-
Save rs38/6f6deea3f639461384f36fc6a30ac9e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"dotnet_interactive": { | |
"language": "csharp" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"import numpy as np\n", | |
"import matplotlib.pyplot as plt\n", | |
"\n", | |
"#poly: 0.01851,1.6,211\n", | |
"\n", | |
"curve = [0.01851,1.6,211] # 2474 kg Turbo\n", | |
"curveRoll = [0.0,1.6,211] # nur Roll\n", | |
"curveLu = [0.01851,0.0,0.0] # nur Luft\n", | |
"curve4S = [0.01737,1.6,192.1] # Prüfmasse 2334kg Taycan 4s kleine Batterie\n", | |
"curveModelY = [0.02658, 1.059,163.04] #2211kg 255er 19\"\n", | |
"curvePanaGTS = [0.03036, 1.7, 212.6] # Panamera GTS\n", | |
"x = [x for x in np.linspace(0,250,251)]\n", | |
"\n", | |
"r = [np.polyval(curve, i) for i in x]\n", | |
"rroll = [np.polyval(curveRoll, i) for i in x]\n", | |
"rlu = [np.polyval(curveLu, i) for i in x]\n", | |
"r4s = [np.polyval(curve4S, i) for i in x]\n", | |
"rmy = [np.polyval(curveModelY, i) for i in x]\n", | |
"\n", | |
"y = [y/36 for y in r]\n", | |
"yr = [y/36 for y in rroll]\n", | |
"y4s = [y/36 for y in r4s]\n", | |
"yl = [y/36 for y in rlu]\n", | |
"ymy = [y/36 for y in rmy]\n", | |
"\n", | |
"eta = 0.85 #90%\n", | |
"fix = 0.55 #~ 1 kW ständiger Verbrauch für ECUs etc.\n", | |
"\n", | |
"plt.plot(x,y, label=\"Taycan Turbo 20 \")\n", | |
"y = [(r*(1/eta))+((100/v)*fix) for v,r in zip(x,y)]\n", | |
"\n", | |
"plt.grid(True)\n", | |
"#add title\n", | |
"plt.title(\"Fahrwiderstand/Verbrauch\")\n", | |
"#add x and y labels\n", | |
"\n", | |
"plt.xlabel(\"km/h\")\n", | |
"\n", | |
"#show legend for plot \n", | |
"\n", | |
"plt.plot(x,y, 'r--' ,label=\"Taycan Turbo 20 real \")\n", | |
"plt.plot(x,yr, label=\"Taycan Rollwiderstand\") #\"Taycan 4S 19 kl. Akku\")\n", | |
"plt.plot(x,yl, label=\"Taycan Luftwiderstand\") #\"Taycan 4S 19 kl. Akku\")\n", | |
"plt.plot(x,ymy, label=\"Model Y LR 19\") #Panamera GTS 21\" )\n", | |
"plt.legend() \n", | |
"\n", | |
"plt.ylabel(\"kWh/100km\")\n", | |
"# change plot size\n", | |
"plt.rcParams[\"figure.figsize\"] = (12,12)\n", | |
"# grid granularity\n", | |
"plt.yticks(np.arange(0, 60, 2))\n", | |
"plt.ylim(0,44)\n", | |
"plt.xlim(5,200)\n", | |
"\n", | |
"plt.show()\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"eta=0.9 #90%\n", | |
"fix = 1 #1 kW\n", | |
"\n", | |
"y = [r*eta+((100/v)*fix) for v,r in zip(x,y)]\n", | |
"y4s = [y*eta for y in y4s]\n", | |
"ymy = [y*eta for y in ymy]\n", | |
"y\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"\n", | |
"[x1+y1 for x1, y1 in zip(x, y)]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"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.10.9" | |
}, | |
"orig_nbformat": 4, | |
"vscode": { | |
"interpreter": { | |
"hash": "a7085bc572327b70119356b92d91b03dcc8faec7d9473c1710c277a3b78b5c61" | |
} | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment