Fuckrier
DownloadTélécharger
Actions
Vote :
ScreenshotAperçu
Informations
Catégorie :Category: nCreator TI-Nspire
Auteur Author: ラ・エスパーダ・デ・セフィロト
Type : Classeur 3.0.1
Page(s) : 1
Taille Size: 2.05 Ko KB
Mis en ligne Uploaded: 22/10/2024 - 07:29:12
Mis à jour Updated: 22/10/2024 - 07:29:24
Uploadeur Uploader: ラ・エスパーダ・デ・セフィロト (Profil)
Téléchargements Downloads: 1
Visibilité Visibility: Archive publique
Shortlink : http://ti-pla.net/a4267816
Type : Classeur 3.0.1
Page(s) : 1
Taille Size: 2.05 Ko KB
Mis en ligne Uploaded: 22/10/2024 - 07:29:12
Mis à jour Updated: 22/10/2024 - 07:29:24
Uploadeur Uploader: ラ・エスパーダ・デ・セフィロト (Profil)
Téléchargements Downloads: 1
Visibilité Visibility: Archive publique
Shortlink : http://ti-pla.net/a4267816
Description
Fichier Nspire généré sur TI-Planet.org.
Compatible OS 3.0 et ultérieurs.
<<
-- Programa para calcular los coeficientes de Fourier en la TI-Nspire function fourierCoefficients() -- Ingresar los datos necesarios local T = tonumber(input("Ingresa el período (T): ")) -- Período de la función local n_terms = tonumber(input("Número de términos de Fourier: ")) -- Número de términos -- Frecuencia angular local w0 = 2 * math.pi / T -- Función definida por tramos (modificar según el problema) function f(t) -- Ejemplo: f(t) = -5t + 10 para 0 <= t < 2 if t >= 0 and t < 2 then return -5 * t + 10 else return 0 -- Cambiar según sea la función en otras regiones end end -- Cálculo del coeficiente a0 function a0(T) local integral = 0 local dt = 0.01 -- Paso pequeño para aproximar la integral for t = 0, T, dt do integral = integral + f(t) * dt end return (2 / T) * integral end -- Cálculo de los coeficientes an y bn function an_bn(n, T) local a_n, b_n = 0, 0 local dt = 0.01 for t = 0, T, dt do a_n = a_n + f(t) * math.cos(n * w0 * t) * dt b_n = b_n + f(t) * math.sin(n * w0 * t) * dt end return (2 / T) * a_n, (2 / T) * b_n end -- Imprimir el valor de a0 print("Coeficiente a0: ", a0(T)) -- Calcular e imprimir los coeficientes an y bn for n = 1, n_terms do local a_n, b_n = an_bn(n, T) print("a" .. n .. ": ", a_n) print("b" .. n .. ": ", b_n) end end -- Ejecutar el programa fourierCoefficients() Made with nCreator - tiplanet.org
>>
Compatible OS 3.0 et ultérieurs.
<<
-- Programa para calcular los coeficientes de Fourier en la TI-Nspire function fourierCoefficients() -- Ingresar los datos necesarios local T = tonumber(input("Ingresa el período (T): ")) -- Período de la función local n_terms = tonumber(input("Número de términos de Fourier: ")) -- Número de términos -- Frecuencia angular local w0 = 2 * math.pi / T -- Función definida por tramos (modificar según el problema) function f(t) -- Ejemplo: f(t) = -5t + 10 para 0 <= t < 2 if t >= 0 and t < 2 then return -5 * t + 10 else return 0 -- Cambiar según sea la función en otras regiones end end -- Cálculo del coeficiente a0 function a0(T) local integral = 0 local dt = 0.01 -- Paso pequeño para aproximar la integral for t = 0, T, dt do integral = integral + f(t) * dt end return (2 / T) * integral end -- Cálculo de los coeficientes an y bn function an_bn(n, T) local a_n, b_n = 0, 0 local dt = 0.01 for t = 0, T, dt do a_n = a_n + f(t) * math.cos(n * w0 * t) * dt b_n = b_n + f(t) * math.sin(n * w0 * t) * dt end return (2 / T) * a_n, (2 / T) * b_n end -- Imprimir el valor de a0 print("Coeficiente a0: ", a0(T)) -- Calcular e imprimir los coeficientes an y bn for n = 1, n_terms do local a_n, b_n = an_bn(n, T) print("a" .. n .. ": ", a_n) print("b" .. n .. ": ", b_n) end end -- Ejecutar el programa fourierCoefficients() Made with nCreator - tiplanet.org
>>