Public
Edited
Sep 29, 2024
Insert cell
Insert cell
Insert cell
makis - material_properties.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
materialsList=material_properties
Insert cell
viewof material = {
const material = Inputs.select(materialsList, {label: "", format: x => x.formula});
material.style.width = "100px";
return material;
}
Insert cell
Insert cell
Insert cell
Insert cell
makis - binary_alloys.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
alloysList = binary_alloys
Insert cell
viewof element1 = Inputs.select(alloysList, {label: "", format: x => x.element})
Insert cell
// viewof alloysatoms1 = Inputs.number([0, Infinity], {step: 1, label: "", value: 1})

viewof alloysatoms1 = html`<input type="number" min="0" value="1" step="1" style="width: 80px;">`;
Insert cell
viewof element2 = Inputs.select(alloysList, {label: "", format: x => x.element})
Insert cell
// viewof alloysatoms2 = Inputs.number([0, Infinity], {step: 1, label: "", value:1})

viewof alloysatoms2 = html`<input type="number" min="0" value="1" step="1" style="width: 80px;">`;
Insert cell
createdAlloyDensity=element1.density*(alloysatoms1/(alloysatoms1+alloysatoms2))+element2.density*(alloysatoms2/(alloysatoms1+alloysatoms2))
Insert cell
createdAlloyAtomicWeight=(element1.mol)*alloysatoms1+(element2.mol)*alloysatoms2
Insert cell
function binaryalloys_table(lang) {
viewof alloysatoms1.addEventListener("input", () => {
setTimeout(() => {
viewof alloysatoms1.focus();
}, 100);
});
viewof alloysatoms2.addEventListener("input", () => {
setTimeout(() => {
viewof alloysatoms2.focus();
}, 100);
});
return html`
<table style="table-layout:fixed; width:100%;">
<thead>
<tr>
<th>${lang == "en" ? "Element" : "Στοιχείο"}</th>
<th>${lang == "en" ? "Number of atoms in the alloy" : "Αριθμός ατόμος στο κράμα"}</th>
<th>${lang == "en" ? "Atomic %" : "Ατομικό %"}</th>
<th>${lang == "en" ? "Density (kg/m³)" : "Πυκνότητα (kg/m³)"}</th>
<th>${lang == "en" ? "Atomic Weight (u)" : "Ατομικό βάρος (u)"}</th>
</tr>
</thead>
<tbody>
<tr>
<td>${viewof element1}</td>
<td>${viewof alloysatoms1}</td>
<td>${(alloysatoms1/(alloysatoms1+alloysatoms2)*100).toFixed(2)}%</td>
<td>${element1.density}</td>
<td>${element1.mol}</td>
</tr>
<tr>
<td>${viewof element2}</td>
<td>${viewof alloysatoms2}</td>
<td>${(alloysatoms2/(alloysatoms1+alloysatoms2)*100).toFixed(2)}%</td>
<td>${element2.density}</td>
<td>${element2.mol}</td>
</tr>
<tr>
<td></td>
<td></td>
<td><h3 style="color:red">${lang == "en" ? "Alloy" : "Κράμα"}</h2></td>
<td><h3>${createdAlloyDensity.toFixed(2)}</h2></td>
<td><h3>${createdAlloyAtomicWeight.toFixed(2)}</h2></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td><h4 style="color:red">${lang == "en" ? "Density (Kg/m³)" : "Πυκνότητα (kg/m³)"}</h3></td>
<td><h4 style="color:red">${lang == "en" ? "Molecular Weight (u)" : "Μοριακό βάρος (u)"}</h3></td>
</tr>
</tbody>
</table>
`
}
Insert cell
binaryalloys_table_en = binaryalloys_table("en")
Insert cell
binaryalloys_table_gr = binaryalloys_table("gr")
Insert cell
Insert cell
viewof unitX = Inputs.select(unitX_hysterisis, {label: "Select the unit for x-axis (magnetic field)"})
Insert cell
viewof unitX_gr = Inputs.select(unitX_hysterisis, {label: "Επιλέξτε μονάδα μέτρησης για τον άξονα x (Μαγνητικό Πεδίο)"})
Insert cell
viewof unitY = Inputs.select(unitY_hysterisis, {label: "Select the unit for y-axis (magnetization)"})
Insert cell
viewof unitY_gr = Inputs.select(unitY_hysterisis, {label: "Επιλέξτε μονάδα μέτρησης για τον άξονα y (Μαγνήτιση)"})
Insert cell
viewof csvfile = Inputs.file({label: "Upload your CSV file", accept: ".csv", required: true});
Insert cell
Insert cell
scatterlot = Plot.plot({
grid: true,
x: {domain: [-1,1], label: `Magnetic Field (${unitX})`},
y: {label: `Magnetization (${unitY})`},
marks: [
Plot.dot(hysteresisLoopData,
{x: "magnetic_field", y: "magnetization"}
)
]
})
Insert cell
scatterlot_gr = Plot.plot({
grid: true,
x: {domain: [-1,1], label: `Μαγνητικό Πεδίο (${unitX_gr})`},
y: {label: `Μαγνήτιση (${unitY_gr})`},
marks: [
Plot.dot(hysteresisLoopData,
{x: "magnetic_field", y: "magnetization"}
)
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
scatterlot__ni_rod_en = scatterplot_function(hysteresisLoopData_ni_rod,"en")
Insert cell
button1_en = downloadButtonPNG(scatterlot__ni_rod_en, {filename:"scatterplot-ni-rod.png"})
Insert cell
Insert cell
Insert cell
scatterlot__ni_rod_gr = scatterplot_function(hysteresisLoopData_ni_rod,"gr")
Insert cell
button1_gr = downloadButtonPNG(scatterlot__ni_rod_gr, {filename:"scatterplot-ni-rod.png", buttonText:"Κατεβάστε σε μορφή PNG"})
Insert cell
button1txt_gr = downloadbuttonTXT4("gr")
Insert cell
scatterlot_Fe3O4_en = scatterplot_function(hysteresisLoopData_Fe3O4, "en")
Insert cell
button2_en = downloadButtonPNG(scatterlot_Fe3O4_en, {filename:"scatterplot-Fe304.png"})
Insert cell
button2txt_en = downloadbuttonTXT1("en")
Insert cell
scatterlot_Fe3O4_gr = scatterplot_function(hysteresisLoopData_Fe3O4, "gr")
Insert cell
button2_gr = downloadButtonPNG(scatterlot_Fe3O4_gr, {filename:"scatterplot-Fe304.png", buttonText:"Κατεβάστε σε μορφή PNG"})
Insert cell
button2txt_gr = downloadbuttonTXT1("gr")
Insert cell
scatterlot_protopasta_en = scatterplot_function(hysteresisLoopData_protopasta, "en")
Insert cell
button3_en = downloadButtonPNG(scatterlot_protopasta_en, {filename:"scatterplot-protopasta.png"})
Insert cell
button3txt_en = downloadbuttonTXT3("en")
Insert cell
scatterlot_protopasta_gr = scatterplot_function(hysteresisLoopData_protopasta, "gr")
Insert cell
button3_gr = downloadButtonPNG(scatterlot_protopasta_gr, {filename:"scatterplot-protopasta.png", buttonText:"Κατεβάστε σε μορφή PNG"})
Insert cell
button3txt_gr = downloadbuttonTXT3("gr")
Insert cell
scatterlot_ni_nanoparticles_en = scatterplot_function(hysteresisLoopData_ni_nanoparticles, "en")
Insert cell
button4_en = downloadButtonPNG(scatterlot_ni_nanoparticles_en, {filename:"scatterplot-ni-nanoparticles.png"})
Insert cell
button4txt_en = downloadbuttonTXT2("en")
Insert cell
scatterlot_ni_nanoparticles_gr = scatterplot_function(hysteresisLoopData_ni_nanoparticles, "gr")
Insert cell
button4_gr = downloadButtonPNG(scatterlot_ni_nanoparticles_gr, {filename:"scatterplot-ni-nanoparticles.png", buttonText:"Κατεβάστε σε μορφή PNG"})
Insert cell
button4txt_gr = downloadbuttonTXT2("gr")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
results_en = results_surface_atoms("en")
Insert cell
Insert cell
Insert cell
Insert cell
results_gr = results_surface_atoms("gr")
Insert cell
function results_surface_atoms(lang) {
if (lang == "en") {
if (selected_type == "sphere" && sphere_radius !== 0) {
return html`V<sub>surface</sub> = ${Math.round((4*Math.PI*Math.pow(sphere_radius,2)*atomic_layer)*1000)/1000} μm<sup>2</sup><br />
V<sub>sphere</sub> = ${Math.round(((4/3)*Math.PI*Math.pow(sphere_radius,3))*1000)/1000} μm<sup>3</sup> <br /> <hr style="margin-top:0; margin-bottom:0" />
Surface atoms percentage = ${Math.round(((3*atomic_layer/sphere_radius)*100)*1000)/1000} %`;
} else if (selected_type == "cuboid" && cuboid_height !==0 && cuboid_length !== 0 && cuboid_width !== 0) {
return html`V<sub>surface</sub> = ${Math.round(((2*cuboid_width*cuboid_length*atomic_layer)+(2*cuboid_length*cuboid_height*atomic_layer)+(2*cuboid_width*cuboid_height*atomic_layer))*1000)/1000} μm<sup>2</sup><br />
V<sub>cuboid</sub> = ${Math.round((cuboid_height*cuboid_length*cuboid_width)*1000)/1000} μm<sup>3</sup> <br /> <hr style="margin-top:0; margin-bottom:0" />
Surface atoms percentage = ${Math.round(((2*atomic_layer*(1/cuboid_height+1/cuboid_length+1/cuboid_width))*100)*1000)/1000} %`;
} else if (selected_type == "rod" && rod_radius !== 0) {
return html`V<sub>surface</sub> = ${Math.round((2*Math.PI*rod_radius*rod_length*atomic_layer)*1000)/1000} μm<sup>2</sup><br />
V<sub>rod</sub> = ${Math.round((Math.PI*Math.pow(rod_radius,2)*rod_length)*1000)/1000} μm<sup>3</sup> <br /> <hr style="margin-top:0; margin-bottom:0" />
Surface atoms percentage = ${Math.round(((2*atomic_layer/rod_radius)*100)*1000)/1000} %`;
} else {
return html``;
}
} else {
if (selected_type_gr == "σφαίρα" && sphere_radius_gr !== 0) {
return html`V<sub>επιφάνειας</sub> = ${Math.round((4*Math.PI*Math.pow(sphere_radius_gr,2)*atomic_layer_gr)*1000)/1000} μm<sup>2</sup><br />
V<sub>σφαίρας</sub> = ${Math.round(((4/3)*Math.PI*Math.pow(sphere_radius_gr,3))*1000)/1000} μm<sup>3</sup> <br /> <hr style="margin-top:0; margin-bottom:0" />
Ποσοστό ατόμων επιφάνειας = ${Math.round(((3*atomic_layer_gr/sphere_radius_gr)*100)*1000)/1000} %`;
} else if (selected_type_gr == "κυβοειδές" && cuboid_height_gr !==0 && cuboid_length_gr !== 0 && cuboid_width_gr !== 0) {
return html`V<sub>επιφάνειας</sub> = ${Math.round((2*cuboid_width_gr*cuboid_length_gr*atomic_layer_gr+2*cuboid_length_gr*cuboid_height_gr*atomic_layer_gr+2*cuboid_width_gr*cuboid_height_gr*atomic_layer_gr)*1000)/1000} μm<sup>2</sup><br />
V<sub>κυβοειδούς</sub> = ${Math.round((cuboid_height_gr*cuboid_length_gr*cuboid_width_gr)*1000)/1000} μm<sup>3</sup> <br /> <hr style="margin-top:0; margin-bottom:0" />
Ποσοστό ατόμων επιφάνειας = ${Math.round(((2*atomic_layer_gr*(1/cuboid_height_gr+1/cuboid_length_gr+1/cuboid_width_gr))*100)*1000)/1000} %`;
} else if (selected_type_gr == "κύλινδρος" && rod_radius_gr !== 0) {
return html`V<sub>επιφάνειας</sub> = ${Math.round((2*Math.PI*rod_radius_gr*rod_length_gr*atomic_layer_gr)*1000)/1000} μm<sup>2</sup><br />
V<sub>κυλίνδρου</sub> = ${Math.round((Math.PI*Math.pow(rod_radius_gr,2)*rod_length_gr)*1000)/1000} μm<sup>3</sup> <br /> <hr style="margin-top:0; margin-bottom:0" />
Ποσοστό ατόμων επιφάνειας = ${Math.round(((2*atomic_layer_gr/rod_radius_gr)*100)*1000)/1000} %`;
} else {
return html``;
}
}
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function table_unit_conv(lang) {
viewof magnitude.addEventListener("input", () => {
setTimeout(() => {
viewof magnitude.focus();
}, 100);
});
return html`
<table style="table-layout:fixed; width:100%;">
<thead>
<tr>
<th>${lang == "en" ? "Material" : "Υλικό"}</th>
<th>${lang == "en" ? "Unit 1" : "Μονάδα Μέτρησης 1"}</th>
<th>${lang == "en" ? "Magnitude 1": "Μαγνήτιση 1"}</th>
<th>${lang == "en" ? "Convert to" : "Μετατροπή σε"}</th>
<th>${lang == "en" ? "Unit 2" : "Μονάδα Μέτρησης 2"}</th>
<th>${lang == "en" ? "Magnitude 2" : "Μαγνήτιση 2"}</th>
</tr>
</thead>
<tbody>
<tr>
<td>${viewof selected_el}</td>
<td>${viewof selected_unit1}</td>
<td>${viewof magnitude}</td>
<td style="text-align: center;">=</td>
<td>${viewof selected_unit2}</td>
<td style="text-align: center; font-weight: bold">${unitsArr.filter(el => el["unit"] === selected_unit1)[0][selected_unit2]}</td>
</tr>
</tbody>
</table>
`
}
Insert cell
table_unit_conv_en = table_unit_conv("en")
Insert cell
Insert cell
Insert cell
Insert cell
elements_list = makisMagnetic_unit_conversions
Insert cell
viewof selected_el = {
const selected_el = Inputs.select(elements_list, {label: "", format: x => x.Element});
selected_el.style.width = "100px";
return selected_el;
}
Insert cell
units_list = ["T(Tesla)","A/m","kA/m","A.m²/kg","G(Gauss)","Oe(Oersted)","emu/g","emu/cm³"]
Insert cell
viewof selected_unit1 = {
const selected_unit1 = Inputs.select(units_list, {label: ""});
selected_unit1.style.width = "100px";
return selected_unit1;
}
Insert cell
viewof selected_unit2 = {
const selected_unit2 = Inputs.select(units_list, {label: ""});
selected_unit2.style.width = "100px";
return selected_unit2;
}
Insert cell
// viewof magnitude = Inputs.number([0, Infinity], {label: "", value: 1})

viewof magnitude = html`<input type="number" min="0" value="1" style="width: 80px;">`;
Insert cell
makis - magnetic_unit_conversions@2.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof user_custom_b_gr = Inputs.number([0, Infinity], {label: "Δώστε τιμή για το b (FWHM - Πλήρες εύρος στο 1/2 του μεγίστου) σε μοίρες", value: 0})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
density_cell
Insert cell
user_custom_density
Insert cell
table_vol_fraction_en = table_vol_fraction("en")
Insert cell
table_vol_fraction_gr = table_vol_fraction("gr")
Insert cell
function table_vol_fraction(lang) {
viewof user_custom_mol_weight.addEventListener("input", () => {
setTimeout(() => {
viewof user_custom_mol_weight.focus();
}, 100);
});
viewof user_custom_density.addEventListener("input", () => {
setTimeout(() => {
viewof user_custom_density.focus();
}, 100);
});
viewof user_custom_R.addEventListener("input", () => {
setTimeout(() => {
viewof user_custom_R.focus();
}, 100);
});
viewof user_custom_sol_vol.addEventListener("input", () => {
setTimeout(() => {
viewof user_custom_sol_vol.focus();
}, 100);
});
viewof user_custom_sol_conc.addEventListener("input", () => {
setTimeout(() => {
viewof user_custom_sol_conc.focus();
}, 100);
});
return html`
<div style="overflow-x:auto;">
<table style="table-layout:flex; width:100%;">
<thead>
<tr>
<th colspan="3" style="text-align: center; border-right: solid 1px">${lang == "en" ? "Material Data" : "Υλικό"}</th>
<th colspan="3" style="text-align: center; border-right: solid 1px">${lang == "en" ? "1 Particle (P)" :"1 Σωματίδιο (P)"}</th>
<th colspan="2" style="text-align: center; border-right: solid 1px">${lang == "en" ? "Solution" : "Διάλυμα"}</th>
<th colspan="4" style="text-align: center">${lang == "en" ? "Particles in Solution" : "Σωματίδια στο Διάλυμα"}</th>
</tr>
</thead>
<tbody>
<tr>
<td>${lang == "en" ? "Formula" : "Χημικός Τύπος"}</td>
<td style="text-align: center">${lang == "en" ? "Molecular Weight" : "Μοριακό Βάρος"}</td>
<td style="text-align: center; border-right: solid 1px">${lang == "en" ? "Density": "Πυκνότητα"}<sub>MNPs</sub>(g/mL)</td>
<td style="text-align: center">R(nm)</td>
<td style="text-align: center">${lang == "en" ? "Volume": "Όγκος"}<sub>P</sub>(cm<sup>3</sup>)</td>
<td style="text-align: center; border-right: solid 1px">${lang == "en" ? "mass": "μάζα"}<sub>P</sub>(g)</td>
<td style="text-align: center">${lang == "en" ? "Solution volume" : "Όγκος"}(mL)</td>
<td style="min-width: 140px; text-align: center; border-right: solid 1px">${lang == "en" ? "Solution Concentration" : "Συγκέντρωση"}<sub>MNPs</sub>(g/mL)</td>
<td style="text-align: center">${lang == "en" ? "Number of Particles" : "Αριθμός Σωματιδίων"}<br />N=m<sub>MNPs</sub>/m<sub>P</sub></td>
<td style="text-align: center">V<sub>${lang == "en" ? "Particles" : "Σωματιδίων"}</sub>(cm<sup>3</sup>)<br />N.V<sub>P</sub></td>
<td style="text-align: center; border-right: solid 1px">${lang == "en" ? "Number of Particles" : "Αριθμός Σωματιδίων"}<br />N=V<sub>MNPs</sub>/V<sub>P</sub></td>
<td style="text-align: center"><strong>${lang == "en" ? "Volume Fraction" : "Κλάσμα Όγκου"}</strong><br />V<sub>MNPs</sub>/V<sub>sol</sub></td>
</tr>
<tr>
<td style="max-width: 50px; text-align: center">${viewof material_mol_weight}</td>
<td style="max-width: 50px; text-align: center">${mol_weight_cell}</td>
<td style="max-width: 50px; text-align: center; border-right: solid 1px">${density_cell}</td>
<td style="max-width: 80px; text-align: center">${viewof user_custom_R}</td>
<td style="min-width: 80px; text-align: center">${MNP_volume_cell}</td>
<td style="min-width: 80px; text-align: center; border-right: solid 1px">${MNP_mass_cell}</td>
<td style="max-width: 80px; text-align: center">${viewof user_custom_sol_vol}</td>
<td style="text-align: center; border-right: solid 1px">${viewof user_custom_sol_conc}</td>
<td style="text-align: center">${num_MNPs_cell !== "NaN" ? num_MNPs_cell : ""}</td>
<td style="text-align: center">${vol_MNPs_cell !== "NaN" ? vol_MNPs_cell : ""}</td>
<td style="text-align: center; border-right: solid 1px">${num_MNPs_vol_cell !== "NaN" ? num_MNPs_vol_cell : ""}</td>
<td style="text-align: center">${vol_fraction_cell !== "NaN" ? vol_fraction_cell + "%" : ""}</td>
</tr>
</tbody>
</table>
</div>
`
}
Insert cell
viewof material_mol_weight = {
const material = Inputs.select(material_mol_weight_list, {label: "", format: x => x.Formula});
material.style.width = "100px";
return material;
}
Insert cell
// viewof user_custom_mol_weight = {
// const user_custom_mol_weight = Inputs.number([0, Infinity], {label: "", value: 0});
// user_custom_mol_weight.style.width = "50px";
// return user_custom_mol_weight;
// }

viewof user_custom_mol_weight = html`<input type="number" min="0" value="0" style="width: 50px;">`;
Insert cell
// viewof user_custom_density = {
// const user_custom_density = Inputs.number([0, Infinity], {label: "", value: 0});
// user_custom_density.style.width = "50px";
// return user_custom_density;
// }

viewof user_custom_density = html`<input type="number" min="0" value="0" style="width: 50px;">`;
Insert cell
// viewof user_custom_R = {
// const user_custom_R = Inputs.number([0, Infinity], {label: "", value: 0});
// user_custom_R.style.width = "80px";
// return user_custom_R;
// }

viewof user_custom_R = html`<input type="number" min="0" value="0" style="width: 80px;">`;
Insert cell
// viewof user_custom_sol_vol = {
// const user_custom_sol_vol = Inputs.number([0, Infinity], {label: "", value: 0});
// user_custom_sol_vol.style.width = "80px";
// return user_custom_sol_vol;
// }

viewof user_custom_sol_vol = html`<input type="number" min="0" value="0" style="width: 80px;">`;
Insert cell
// viewof user_custom_sol_conc = {
// const user_custom_sol_conc = Inputs.number([0, Infinity], {label: "", value: 0});
// user_custom_sol_conc.style.width = "80px";
// return user_custom_sol_conc;
// }

viewof user_custom_sol_conc = html`<input type="number" min="0" value="0" style="width: 80px;">`;
Insert cell
mol_weight_cell = (material_mol_weight.Formula !== "Other") ? material_mol_weight_list.filter(e => e["Formula"]==material_mol_weight["Formula"])[0]["Molecular Weight"] : viewof user_custom_mol_weight
Insert cell
density_cell = (material_mol_weight.Formula !== "Other") ? material_mol_weight_list.filter(e => e["Formula"]==material_mol_weight["Formula"])[0]["Density (g/mL)"] : viewof user_custom_density
Insert cell
MNP_volume_cell = ((4/3)*Math.PI*Math.pow(user_custom_R,3)*Math.pow(10, -21)).toExponential(3)
Insert cell
MNP_mass_cell = {
if (material_mol_weight.Formula !== "Other") {
return (MNP_volume_cell*density_cell).toExponential(3);
} else {
return (MNP_volume_cell*user_custom_density).toExponential(3);
}
}
Insert cell
num_MNPs_cell = ((user_custom_sol_vol*user_custom_sol_conc)/MNP_mass_cell).toExponential(3)
Insert cell
vol_MNPs_cell = (num_MNPs_cell*MNP_volume_cell).toExponential(3)
Insert cell
num_MNPs_vol_cell = {
if (material_mol_weight.Formula !== "Other") {
return (((user_custom_sol_vol*user_custom_sol_conc)/density_cell)/MNP_volume_cell).toExponential(3);
} else {
return (((user_custom_sol_vol*user_custom_sol_conc)/user_custom_density)/MNP_volume_cell).toExponential(3);
}
}
Insert cell
vol_fraction_cell = (Math.round(((vol_MNPs_cell/user_custom_sol_vol)*100)*100)/100).toString()
Insert cell
Insert cell
makis - material_mol_weight@3.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
function table_langevin(lang) {
viewof user_langevin_T.addEventListener("input", () => {
setTimeout(() => {
viewof user_langevin_T.focus();
}, 100);
});
viewof user_langevin_Ms.addEventListener("input", () => {
setTimeout(() => {
viewof user_langevin_Ms.focus();
}, 100);
});
viewof user_langevin_ms.addEventListener("input", () => {
setTimeout(() => {
viewof user_langevin_ms.focus();
}, 100);
});
viewof user_langevin_ρ.addEventListener("input", () => {
setTimeout(() => {
viewof user_langevin_ρ.focus();
}, 100);
});
viewof user_langevin_r.addEventListener("input", () => {
setTimeout(() => {
viewof user_langevin_r.focus();
}, 100);
});
const Md=user_langevin_ρ*user_langevin_Ms;
const φ=user_langevin_ms/user_langevin_Ms;
const Vm=(4/3)*Math.PI*Math.pow(user_langevin_r, 3)*Math.pow(10,-27);
const μ0=4*Math.PI*Math.pow(10, -7);
const kB=1.38*Math.pow(10,-23);
return html`
<table style="table-layout:auto; width:100%; max-width: 100%">
<thead>
<tr>
<th width="9.09%">${lang == "en" ? "Conditions" : "Συνθήκες"}</th>
<th width="45.45%" colspan="5">${lang == "en" ? "Material" : "Υλικό"}</th>
<th width="18.18%" colspan="2">${lang == "en" ? "Size" : "Διαστάσεις"}</th>
<th width="18.18%" colspan="2">${lang == "en" ? "Constants" : "Σταθερές"}</th>
<th width="9.09%">χ<sub>i</sub></th>
</tr>
<tr>
<th>${"T(K)"}</th>
<th>${"ρ(Kgm<sup>-3</sup>)"}</th>
<th>${"M<sub>d</sub>(A/m)"}</th>
<th>${"m<sub>s</sub>(emu/g<->Am<sup>2</sup>/kg)"}</th>
<th>${"M<sub>s</sub>(emu/g<->Am<sup>2</sup>/kg)"}</th>
<th text-align="center">${"φ"}</th>
<th>${"r(nm)"}</th>
<th>${"V<sub>m</sub>(m<sup>3</sup>)"}</th>
<th>${"μ<sub>0</sub>(TmA<sup>-1</sup>)"}</th>
<th>${"k<sub>B</sub>(J/K)"}</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center">${viewof user_langevin_T}</td>
<td>${viewof user_langevin_ρ}</td>
<td style="text-align: center"><strong>${Math.round(Md*1000)/1000}</strong></td>
<td>${viewof user_langevin_ms}</td>
<td>${viewof user_langevin_Ms}</td>
<td style="text-align: center"><strong>${Math.round(φ*1000)/1000}</strong></td>
<td>${viewof user_langevin_r}</td>
<td style="text-align: center"><strong>${Vm.toExponential(4)}</strong></td>
<td>${μ0.toExponential(3)}</td>
<td>${kB.toExponential(3)}</td>
<td style="color: red"><strong>${Math.round((μ0*(φ*Math.pow(Md, 2)*Vm)/(3*kB*user_langevin_T))*1000)/1000}</strong></td>
</tr>
</tbody>
</table>
`
}
Insert cell
langevin_en = table_langevin("en")
Insert cell
langevin_gr = table_langevin("gr")
Insert cell
// viewof user_langevin_T = {
// const user_langevin_T = Inputs.number([0, Infinity], {label: "", value: 0});
// user_langevin_T.style.width = "60px";
// return user_langevin_T;
// }

viewof user_langevin_T = html`<input type="number" min="0" value="0" style="width: 60px;">`;
Insert cell
// viewof user_langevin_ρ = {
// const user_langevin_ρ = Inputs.number([0, Infinity], {label: "", value: 0});
// user_langevin_ρ.style.width = "60px";
// return user_langevin_ρ;
// }

viewof user_langevin_ρ = html`<input type="number" min="0" value="0" style="width: 60px;">`;
Insert cell
// viewof user_langevin_ms = {
// const user_langevin_ms = Inputs.number([0, Infinity], {label: "", value: 0});
// user_langevin_ms.style.width = "60px";
// return user_langevin_ms;
// }

viewof user_langevin_ms = html`<input type="number" min="0" value="0" style="width: 60px;">`;
Insert cell
// viewof user_langevin_Ms = {
// const user_langevin_Ms = Inputs.number([0, Infinity], {label: "", value: 0});
// user_langevin_Ms.style.width = "60px";
// return user_langevin_Ms;
// }

viewof user_langevin_Ms = html`<input type="number" min="0" value="0" style="width: 60px;">`;
Insert cell
// viewof user_langevin_r = {
// const user_langevin_r = Inputs.number([0, Infinity], {label: "", value: 0});
// user_langevin_r.style.width = "60px";
// return user_langevin_r;
// }

viewof user_langevin_r = html`<input type="number" min="0" value="0" style="width: 60px;">`;
Insert cell
Insert cell
// viewof user_chantrell_Ms = {
// const user_chantrell_Ms = Inputs.number([0, Infinity], {label: "", value: 0});
// user_chantrell_Ms.style.width = "60px";
// return user_chantrell_Ms;
// }

viewof user_chantrell_Ms = html`<input type="number" min="0" value="95" style="width: 60px;">`;
Insert cell
// viewof user_chantrell_ms = {
// const user_chantrell_ms = Inputs.number([0, Infinity], {label: "", value: 0});
// user_chantrell_ms.style.width = "60px";
// return user_chantrell_ms;
// }

viewof user_chantrell_ms = html`<input type="number" min="0" value="45" style="width: 60px;">`;
Insert cell
// viewof user_chantrell_χin = {
// const user_chantrell_χin = Inputs.number([0, Infinity], {label: "", value: 0});
// user_chantrell_χin.style.width = "60px";
// return user_chantrell_χin;
// }

viewof user_chantrell_χin = html`<input type="number" min="0" value="0.13" style="width: 60px;">`;
Insert cell
// viewof user_chantrell_T = {
// const user_chantrell_T = Inputs.number([0, Infinity], {label: "", value: 0});
// user_chantrell_T.style.width = "60px";
// return user_chantrell_T;
// }

viewof user_chantrell_T = html`<input type="number" min="0" value="300" style="width: 60px;">`;
Insert cell
// viewof user_chantrell_H0 = {
// const user_chantrell_H0 = Inputs.number([0, Infinity], {label: "", value: 0});
// user_chantrell_H0.style.width = "80px";
// return user_chantrell_H0;
// }

viewof user_chantrell_H0 = html`<input type="number" min="0" value="125000" style="width: 60px;">`;
Insert cell
function table_chantrell(lang) {
viewof user_chantrell_Ms.addEventListener("input", () => {
setTimeout(() => {
viewof user_chantrell_Ms.focus();
}, 100);
});
viewof user_chantrell_ms.addEventListener("input", () => {
setTimeout(() => {
viewof user_chantrell_ms.focus();
}, 100);
});
viewof user_chantrell_χin.addEventListener("input", () => {
setTimeout(() => {
viewof user_chantrell_χin.focus();
}, 100);
});
viewof user_chantrell_T.addEventListener("input", () => {
setTimeout(() => {
viewof user_chantrell_T.focus();
}, 100);
});
viewof user_chantrell_H0.addEventListener("input", () => {
setTimeout(() => {
viewof user_chantrell_H0.focus();
}, 100);
});
const kB=1.38*Math.pow(10,-23);
const DM=Math.pow((((18*kB*user_chantrell_T)/(Math.PI*user_chantrell_Ms))*Math.sqrt(user_chantrell_χin/(3*user_chantrell_ms*user_chantrell_H0))), (1/3));
const dev=(1/3)*Math.sqrt(Math.log((3*user_chantrell_χin)/(user_chantrell_ms/user_chantrell_H0)));
return html`
<table style="table-layout:auto; width:100%; max-width: 100%">
<thead>
<tr>
<th width="80%" colspan="6">${lang == "en" ? "Components of Equation" : "Παράμετροι εξίσωσης"}</th>
<th width="10%" >${"D<sub>M</sub> (nm)"}</th>
<th width="10%" >${"σ<sub>ν</sub> (nm)"}</th>
</tr>
<tr>
<th>${"M<sub>s</sub>(emu/g<->Am<sup>2</sup>/kg)"}</th>
<th>${"m<sub>s</sub>(emu/g<->Am<sup>2</sup>/kg)"}</th>
<th>${"χ<sub>in</sub>"}</th>
<th>${"T(K)"}</th>
<th>${"H<sub>0</sub>(A/m)"}</th>
<th>${"k<sub>B</sub>(J/K)"}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>${viewof user_chantrell_Ms}</td>
<td>${viewof user_chantrell_ms}</td>
<td>${viewof user_chantrell_χin}</td>
<td>${viewof user_chantrell_T}</td>
<td>${viewof user_chantrell_H0}</td>
<td>${kB.toExponential(3)}</td>
<td style="color:red"><strong>${Math.round((DM*Math.pow(10,9))*100)/100}</strong></td>
<td>${Math.round(dev*100)/100}</td>
</tr>
</tbody>
</table>
`
}
Insert cell
table_chantrell_en = table_chantrell("en")
Insert cell
table_chantrell_gr = table_chantrell("gr")
Insert cell
Insert cell
function downloadbuttonTXT1(lang) {
const button = DOM.download(
FileAttachment("Fe3O4-nanoparticles.txt").blob(),
FileAttachment("Fe3O4-nanoparticles.txt").name,
`${lang == "en" ? "Download TXT" : "Κατεβάστε σε μορφή TXT"}`
);
return button;
}
Insert cell
function downloadbuttonTXT2(lang) {
const button = DOM.download(
FileAttachment("ni-nanoparticles.txt").blob(),
FileAttachment("ni-nanoparticles.txt").name,
`${lang == "en" ? "Download TXT" : "Κατεβάστε σε μορφή TXT"}`
);
return button;
}
Insert cell
function downloadbuttonTXT3(lang) {
const button = DOM.download(
FileAttachment("protopasta-3dfilament.txt").blob(),
FileAttachment("protopasta-3dfilament.txt").name,
`${lang == "en" ? "Download TXT" : "Κατεβάστε σε μορφή TXT"}`
);
return button;
}
Insert cell
function downloadbuttonTXT4(lang) {
const button = DOM.download(
FileAttachment("ni-rod-hl.txt").blob(),
FileAttachment("ni-rod-hl.txt").name,
`${lang == "en" ? "Download TXT" : "Κατεβάστε σε μορφή TXT"}`
);
return button;
}
Insert cell
import {downloadButtonPNG} from "@pavlos/download-buttons"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more