power check ok
This commit is contained in:
parent
4bf0dfc70d
commit
b904f19500
|
@ -1,3 +1,3 @@
|
|||
#include <math.h>
|
||||
|
||||
//double *power(int **p);
|
||||
void *power(int **p, double a[]);
|
1600022
Code-C/rawData.txt
1600022
Code-C/rawData.txt
File diff suppressed because it is too large
Load diff
|
@ -1,39 +1,34 @@
|
|||
import math
|
||||
import numpy as np
|
||||
# import matplotlib.pyplot as plt
|
||||
import matplotlib.pyplot as plt
|
||||
import csv
|
||||
|
||||
#"C:\Users\quent\OneDrive\Bureau\ENSC\TransD\Framboisier\02400001.TXT"
|
||||
#! /usr/bin/env python3
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
|
||||
|
||||
|
||||
taille = 100000
|
||||
freq = 250
|
||||
periode = 1 / freq
|
||||
temps = periode * taille
|
||||
resultat = np.zeros(taille)
|
||||
i = 0
|
||||
resultat = np.zeros([taille,8])
|
||||
j = 0
|
||||
# opening the CSV file
|
||||
with open('rawData.csv', mode ='r') as file:
|
||||
|
||||
# reading the CSV file
|
||||
csvFile = csv.DictReader(file)
|
||||
csvFile = csv.reader(file, delimiter=",")
|
||||
|
||||
# displaying the contents of the CSV file
|
||||
for lines in csvFile:
|
||||
resultat[i] = lines
|
||||
print(lines)
|
||||
i+=1
|
||||
|
||||
|
||||
|
||||
"""
|
||||
line = np.zeros(8)
|
||||
for i in range(8):
|
||||
line[i] = lines[i+1]
|
||||
resultat[j] = line
|
||||
j+=1
|
||||
if(j == taille) : break
|
||||
#print(resultat.shape)
|
||||
resultat*=resultat
|
||||
for i in range(8):
|
||||
aire = 0
|
||||
for i in range(taille-1):
|
||||
aire += (resultat[i]+resultat[i+1]) / 2 * periode
|
||||
for j in range(taille-1):
|
||||
aire += (resultat[j,i]+resultat[j+1,i]) / 2 * periode
|
||||
res = aire/temps
|
||||
print(res)"""
|
||||
print("power c°" + str(i+1) + " : " + str(res))
|
Loading…
Reference in a new issue