elmo
Montreal, Quebec, Canada
 
 
it's elmo but earl
Не в сети
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}")
Витрина предметов
Витрина редчайших достижений
Недавняя активность
67 ч. всего
последний запуск 4 июл. 2023 г.
40 ч. всего
последний запуск 4 июл. 2023 г.
5,2 ч. всего
последний запуск 23 мая. 2023 г.
Достижения   0 из 98
Комментарии
Adolace 31 авг. 2024 г. в 11:46 
cool game
76561199260463324 24 июл. 2023 г. в 10:02 
lets go party in csgo
76561199041963229 Обмен заблокирован 22 ноя. 2021 г. в 13:50 
Im interested to buy your item on steam market, but i need to talk about prices, add me if u can.
76561198109744297 Обмен заблокирован 25 июл. 2021 г. в 20:40 
hello man. add me if you want to sell your knife.
director 16 июл. 2021 г. в 0:05 
send me a friend request, I need to talk to you
Jotus 4 июн. 2021 г. в 4:54 
hi mate, can you add me? just for a quick chat