3_moments_
DownloadTélécharger
Actions
Vote :
ScreenshotAperçu

Informations
Catégorie :Category: nCreator TI-Nspire
Auteur Author: brianpastour1
Type : Classeur 3.0.1
Page(s) : 1
Taille Size: 2.67 Ko KB
Mis en ligne Uploaded: 30/07/2025 - 13:23:02
Mis à jour Updated: 30/07/2025 - 13:23:31
Uploadeur Uploader: brianpastour1 (Profil)
Téléchargements Downloads: 0
Visibilité Visibility: Archive publique
Shortlink : https://tipla.net/a4814172
Type : Classeur 3.0.1
Page(s) : 1
Taille Size: 2.67 Ko KB
Mis en ligne Uploaded: 30/07/2025 - 13:23:02
Mis à jour Updated: 30/07/2025 - 13:23:31
Uploadeur Uploader: brianpastour1 (Profil)
Téléchargements Downloads: 0
Visibilité Visibility: Archive publique
Shortlink : https://tipla.net/a4814172
Description
Fichier Nspire généré sur TI-Planet.org.
Compatible OS 3.0 et ultérieurs.
<<
-- Programme TI-Nspire : RDM Automatique (Forces & 3 Moments) avec tracé M(x) et V(x) function tracer_MV(L, q, P, xP) local gc = platform.window:gc() local w, h = platform.window:width(), platform.window:height() gc:setColorRGB(255,255,255) gc:fillRect(0,0,w,h) gc:setColorRGB(0,0,0) gc:drawLine(40, h/2, w-20, h/2) gc:drawLine(40, 20, 40, h-20) gc:drawString("Diagrammes M(x) (bleu) et V(x) (rouge)", 50, 10, "top") local prevMx, prevMy, prevVx, prevVy for i=0,100 do local x = (i/100)*L local M, V = 0, 0 if q > 0 then M = M + q*x*(L-x)/2 V = V + q*(L/2 - x) end if P > 0 then local a = xP local b = L - a if x <= a then M = M + P*b*x/L V = V + P*b/L else M = M + P*a*(L-x)/L V = V - P*a/L end end local px = 40 + (x/L)*(w-80) local pyM = h/2 - (M/((q>0 and q*L^2/8) or (P>0 and P*L/4) or 1))*(h/4) local pyV = h/2 - (V/((q>0 and q*L/2) or (P>0 and P/2) or 1))*(h/4) gc:setColorRGB(0,0,255) if prevMx then gc:drawLine(prevMx, prevMy, px, pyM) end gc:setColorRGB(255,0,0) if prevVx then gc:drawLine(prevVx, prevVy, px, pyV) end prevMx, prevMy = px, pyM prevVx, prevVy = px, pyV end end function menu() print("=== RDM - TI-Nspire ===") print("1) Methode des Forces (Mohr)") print("2) Formule des 3 Moments") choix = tonumber(io.read()) if choix == 1 then methode_forces() elseif choix == 2 then trois_moments() else print("Choix invalide") end end function methode_forces() print("--- Methode des Forces ---") io.write("Longueur L (m): ") L = tonumber(io.read()) io.write("Charge uniforme q (kN/m), 0 si aucune: ") q = tonumber(io.read()) io.write("Charge ponctuelle P (kN), 0 si aucune: ") P = tonumber(io.read()) io.write("Position de P (m depuis A), 0 si aucune: ") xP = tonumber(io.read()) print("Moments isostatiques: ") if q > 0 then print("M max q = ", q*L^2/8, " kNm") end if P > 0 then print("M max P = ", P*xP*(L-xP)/L, " kNm") end platform.window:invalidate() function on.paint(gc) tracer_MV(L, q, P, xP) end end function trois_moments() print("--- Formule des 3 Moments ---") io.write("Longueur L1 (m): ") L1 = tonumber(io.read()) io.write("Charge uniforme g1 (kN/m): ") g1 = tonumber(io.read()) io.write("Longueur L2 (m): ") L2 = tonumber(io.read()) io.write("Charge uniforme g2 (kN/m): ") g2 = tonumber(io.read()) A1 = g1*L1^2/2 A2 = g2*L2^2/2 MB = -6*(* Made with nCreator - tiplanet.org
>>
Compatible OS 3.0 et ultérieurs.
<<
-- Programme TI-Nspire : RDM Automatique (Forces & 3 Moments) avec tracé M(x) et V(x) function tracer_MV(L, q, P, xP) local gc = platform.window:gc() local w, h = platform.window:width(), platform.window:height() gc:setColorRGB(255,255,255) gc:fillRect(0,0,w,h) gc:setColorRGB(0,0,0) gc:drawLine(40, h/2, w-20, h/2) gc:drawLine(40, 20, 40, h-20) gc:drawString("Diagrammes M(x) (bleu) et V(x) (rouge)", 50, 10, "top") local prevMx, prevMy, prevVx, prevVy for i=0,100 do local x = (i/100)*L local M, V = 0, 0 if q > 0 then M = M + q*x*(L-x)/2 V = V + q*(L/2 - x) end if P > 0 then local a = xP local b = L - a if x <= a then M = M + P*b*x/L V = V + P*b/L else M = M + P*a*(L-x)/L V = V - P*a/L end end local px = 40 + (x/L)*(w-80) local pyM = h/2 - (M/((q>0 and q*L^2/8) or (P>0 and P*L/4) or 1))*(h/4) local pyV = h/2 - (V/((q>0 and q*L/2) or (P>0 and P/2) or 1))*(h/4) gc:setColorRGB(0,0,255) if prevMx then gc:drawLine(prevMx, prevMy, px, pyM) end gc:setColorRGB(255,0,0) if prevVx then gc:drawLine(prevVx, prevVy, px, pyV) end prevMx, prevMy = px, pyM prevVx, prevVy = px, pyV end end function menu() print("=== RDM - TI-Nspire ===") print("1) Methode des Forces (Mohr)") print("2) Formule des 3 Moments") choix = tonumber(io.read()) if choix == 1 then methode_forces() elseif choix == 2 then trois_moments() else print("Choix invalide") end end function methode_forces() print("--- Methode des Forces ---") io.write("Longueur L (m): ") L = tonumber(io.read()) io.write("Charge uniforme q (kN/m), 0 si aucune: ") q = tonumber(io.read()) io.write("Charge ponctuelle P (kN), 0 si aucune: ") P = tonumber(io.read()) io.write("Position de P (m depuis A), 0 si aucune: ") xP = tonumber(io.read()) print("Moments isostatiques: ") if q > 0 then print("M max q = ", q*L^2/8, " kNm") end if P > 0 then print("M max P = ", P*xP*(L-xP)/L, " kNm") end platform.window:invalidate() function on.paint(gc) tracer_MV(L, q, P, xP) end end function trois_moments() print("--- Formule des 3 Moments ---") io.write("Longueur L1 (m): ") L1 = tonumber(io.read()) io.write("Charge uniforme g1 (kN/m): ") g1 = tonumber(io.read()) io.write("Longueur L2 (m): ") L2 = tonumber(io.read()) io.write("Charge uniforme g2 (kN/m): ") g2 = tonumber(io.read()) A1 = g1*L1^2/2 A2 = g2*L2^2/2 MB = -6*(* Made with nCreator - tiplanet.org
>>