blob: ab85ffd76fbdf94a0554b9035f7e33360adf568a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
clear
//Initialisation
c=100*10**-6 //capacitance in farad
r=100*10**3 //resistance in ohm
v=20 //volt
t=25 //time in seconds
e=2.71828 //mathematical constant
//Calculation
T=c*r //time in seconds
v1=v*(1-e**(-t*T**-1)) //volt
//Result
printf("\n v = %.2f V",v1)
|