#include <stdio.h>
#include <math.h>
#define N 101
#define DT 0.01
int main(){
int i;
float A =1.0, f=1.0 , p=0.0 , t[N] , v[N] , cur[N] , C=0.1 ;
for(i = 0; i < N ; i++){
t[i]=i*DT;
v[i]=A*sin(2.0*(M_PI)*f*t[i]+p);
}
for(i = 0; i < N ; i++){
cur[i]=C * (v[i+1]-v[i]) / DT;
printf("%f\t%f\t%f\n", t[i],v[i],cur[i]);
}
return 0;
}
前へ次へ