194 lines
3.9 KiB
Plaintext
194 lines
3.9 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "ba4e56bc",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Valori statici (calibro)\n",
|
|
"N = 10\n",
|
|
"\n",
|
|
"A = 23.97 +- 0.16 "
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "aaf30c1f",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Valori statici (sonar)\n",
|
|
"N = 6\n",
|
|
"\n",
|
|
"A = 23.46 +- 0.23\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "7a851edb",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Valori dinamici (sonar)\n",
|
|
"N = 4\n",
|
|
"\n",
|
|
"K nostro: 24.35 +- 0.25\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 10,
|
|
"id": "b349ba73",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import numpy as np\n",
|
|
"from scipy.stats import t as student_t"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 11,
|
|
"id": "a68eb302",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"t = 1.751\n",
|
|
"p-value (two-tailed) = 10.1827 %\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Valori statici (calibro)\n",
|
|
"Nd = 10\n",
|
|
"Ad = 23.97\n",
|
|
"uAd = 0.16 * 3\n",
|
|
"\n",
|
|
"\n",
|
|
"#Valori statici (sonar)\n",
|
|
"Ns = 6\n",
|
|
"As = 23.46\n",
|
|
"uAs = 0.23 * 3\n",
|
|
"\n",
|
|
"#Nomi coerenti con Cannelli\n",
|
|
"GdL = Nd + Ns - 2\n",
|
|
"\n",
|
|
"s2 = ( (Nd - 1) * uAd**2 + (Ns - 1) * uAs**2 ) / GdL\n",
|
|
"\n",
|
|
"sigma2 = ( s2 / Nd ) + ( s2 / Ns )\n",
|
|
"\n",
|
|
"t = ( Ad - As ) / np.sqrt( sigma2 )\n",
|
|
"\n",
|
|
"\n",
|
|
"p_value = 2 * (1 - student_t.cdf(abs(t), df=GdL))\n",
|
|
"print(f\"t = {t:.3f}\")\n",
|
|
"print(f\"p-value (two-tailed) = {p_value * 100:.4f} %\")\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 12,
|
|
"id": "2746d086",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"t = -1.147\n",
|
|
"p-value (two-tailed) = 27.3612 %\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Valori statici (calibro)\n",
|
|
"Nd = 10\n",
|
|
"Ad = 23.97\n",
|
|
"uAd = 0.16 * 3\n",
|
|
"\n",
|
|
"#Valori dinamici (sonar)\n",
|
|
"Ns = 4\n",
|
|
"As = 24.35\n",
|
|
"uAs = 0.25 * 3\n",
|
|
"\n",
|
|
"#Nomi coerenti con Cannelli\n",
|
|
"GdL = Nd + Ns - 2\n",
|
|
"\n",
|
|
"s2 = ( (Nd - 1) * uAd**2 + (Ns - 1) * uAs**2 ) / GdL\n",
|
|
"\n",
|
|
"sigma2 = ( s2 / Nd ) + ( s2 / Ns )\n",
|
|
"\n",
|
|
"t = ( Ad - As ) / np.sqrt( sigma2 )\n",
|
|
"\n",
|
|
"\n",
|
|
"p_value = 2 * (1 - student_t.cdf(abs(t), df=GdL))\n",
|
|
"print(f\"t = {t:.3f}\")\n",
|
|
"print(f\"p-value (two-tailed) = {p_value * 100:.4f} %\")\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 13,
|
|
"id": "be0c6cc6",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"t = -1.934\n",
|
|
"p-value (two-tailed) = 8.9234 %\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Valori statici (sonar)\n",
|
|
"Nd = 6\n",
|
|
"Ad = 23.46\n",
|
|
"uAd = 0.23 * 3\n",
|
|
"\n",
|
|
"#Valori dinamici (sonar)\n",
|
|
"Ns = 4\n",
|
|
"As = 24.35\n",
|
|
"uAs = 0.25 * 3\n",
|
|
"\n",
|
|
"#Nomi coerenti con Cannelli\n",
|
|
"GdL = Nd + Ns - 2\n",
|
|
"\n",
|
|
"s2 = ( (Nd - 1) * uAd**2 + (Ns - 1) * uAs**2 ) / GdL\n",
|
|
"\n",
|
|
"sigma2 = ( s2 / Nd ) + ( s2 / Ns )\n",
|
|
"\n",
|
|
"t = ( Ad - As ) / np.sqrt( sigma2 )\n",
|
|
"\n",
|
|
"\n",
|
|
"p_value = 2 * (1 - student_t.cdf(abs(t), df=GdL))\n",
|
|
"print(f\"t = {t:.3f}\")\n",
|
|
"print(f\"p-value (two-tailed) = {p_value * 100:.4f} %\")\n"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": ".venv",
|
|
"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.13.5"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|