summaryrefslogtreecommitdiff
path: root/3850/CH31/EX31.7/Ex31_7.sce
blob: dad58a9e2be59cf2ae3c19d970ae71a1c80da077 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

//To Calculate the Energy stored in Capacitor

//Example 31.7

clear;

clc;

C=100*10^-6;//Capacitance of the capacitor in Faraday

V=20;//Potential Difference in Volts

U=1/2*C*V^2;//Formula for finding the energy stored in a capacitor

printf("The energy stored in the capacitor= %f J",U);