elmo
Montreal, Quebec, Canada
 
 
it's elmo but earl
Právě je offline
calculations of an integral
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 29 14:09:43 2023

@author: your mom
"""

# step 1 import necessary librairies

import numpy as np
import matplotlib.pyplot as plt

# step 2 define starting variables

xi = 0
xf = 2
npts = 21
x = np.linspace(xi,xf,npts)
f = np.zeros(npts)
g = np.zeros(npts)

# step 3 define functions that will be later plotted

for i in range(len(x)):
f = x **3
if x <=-1:
g = 3 * x + 2
elif x < 1:
g = f
else:
g = 3 * x - 2

# step 4 graph the functions previously defined

plt.plot(x,f, label = 'f(x)')
plt.plot(x,g, label = 'g(x)')
plt.legend()
plt.title("There is no title idiot")
plt.grid(True, "both", 'both')

# step 5 calculate the integral of the function g(x) between x = 0 and x = 2

A1=0
dx = x[1] - x[0]
for j in range(0,npts-1):
A1= A1 + ( g[j]+g[j+1] )/2*dx
print(f"L'intégrale de la fonction g(x) entre x=0 et x=2 est {A1:.4f}")
Přehlídka položek
Přehlídka nejvzácnějších achievementů
Nedávná aktivita
67 hodin celkem
Naposledy hráno 4. čvc. 2023
40 hodin celkem
Naposledy hráno 4. čvc. 2023
5,2 hodin celkem
Naposledy hráno 23. kvě. 2023
Adolace 31. srp. 2024 v 11.46 
cool game
76561199260463324 24. čvc. 2023 v 10.02 
lets go party in csgo
76561199041963229 Obchodování zakázáno 22. lis. 2021 v 13.50 
Im interested to buy your item on steam market, but i need to talk about prices, add me if u can.
76561198109744297 Obchodování zakázáno 25. čvc. 2021 v 20.40 
hello man. add me if you want to sell your knife.
director 16. čvc. 2021 v 0.05 
send me a friend request, I need to talk to you
Jotus 4. čvn. 2021 v 4.54 
hi mate, can you add me? just for a quick chat