blob: 1fd95f72a9b38112588c196cf92193c5bb608af0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
clear
//Initialisation
c=20*10**-6 //capacitance in farad
r=10*10**3 //resistance in ohm
v=5 //volt
v2=10 //volt
//Calculation
T=c*r //time in seconds
//Result
printf("\n v = %d - %d*e^(-t/%.1f) V",v2,v,T)
|