Une petite interface de physique pour déterminer la capacité thermique d’un calorimètre.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | var m1,mA, m2,mB; var T1,TA, T2,TB, T3,TC; var valid, m1Label, m2Label, T1Label, T2Label, T3Label; var U1,U2,U3,C; function setup() { // create canvas createCanvas(800, 600); background(0, 255, 255); fill(0); textSize(30); text("Détermination de la capacité thermique du calorimètre", 50, 30); fill(255, 0, 0); mA = createInput(); mA.position(20, 100); m1Label = createElement('h2', 'm<sub>1</sub> en g'); m1Label.position(25, 45); mB = createInput(); mB.position(200, 100); m2Label = createElement('h2', 'm<sub>2</sub> en g'); m2Label.position(205, 45); TA = createInput(); TA.position(20, 200); T1Label = createElement('h2', 'T<sub>1</sub> en °C'); T1Label.position(25, 145); TB = createInput(); TB.position(200, 200); T2Label = createElement('h2', 'T<sub>2</sub> en °C'); T2Label.position(215, 145); TC = createInput(); TC.position(400, 200); T3Label = createElement('h2', 'T<sub>3</sub> en °C'); T3Label.position(415, 145); valid = createButton('valider'); valid.position(700, 500); valid.mousePressed(calcul); } function calcul() { background(0,255,255); fill(0); textSize(30); text("Détermination de la capacité thermique du calorimètre", 50, 30); m1 = mA.value()/1000; m2 = mB.value()/1000; T1 = TA.value(); T2= TB.value(); T3 = TC.value(); U1=m1*4.18e3*(T3-T1); U2 =m2*4.18e3*(T3-T2); U3 =-U1-U2; C =U3/(T3-T1); fill(120,120,120); textSize(25); text( "ΔU1 = " + U1 + " Joules", 25,300); text( "ΔU2 = " + U2 + " Joules", 25,350); text( "ΔU3 = " + U3 + " Joules", 25,400); fill(255,0,0); text(" C = " + C + " J./K", 25,500); } |
Commentaires récents