summaryrefslogtreecommitdiff
path: root/1319/CH1/EX1.1/1_1.sce
blob: 2cd7a68e692f1e75f14fa4b2d58629e9c6faabc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// To calculate frequency, instantaneous voltage and time of a voltage wave

clc;
clear;

// The volatage eqaution is v= 0.02 sin (4000t + 30(degress)).


Vm=0.02;

deff('a=vol(b)','a=Vm*sind(((4000*b)*(180/%pi))+30)'); // Function for voltage equation

t=320*(10^-6);

w=4000; // angular frequency

// General expression for voltage is given by V=Vm sin ()(2*pi*f*t)+theta)
// Comparing both the eqautions we get 2*pi*f=4000

f=w/(2*%pi);

v=vol(t);

// 360degress is equal to 1/f s.

//Refer the diagram with this code to understand better. 
// 30degress is

t30=30/(f*360);

disp('Hz',f,'The frequency of the voltage wave =')
disp('V',v,'The instantaneous voltage at t= 320 micro seconds =')

disp('s',t30,'The time represented by 30 degrees phase difference =')