Saturday 30 September 2017

Active Elements and Passive Elements

ACTIVE ELEMENTS

An independent source which can  deliver or absorb energy  continuously is called an active element . The voltage of an ideal source is assumed to be independent of the current in the circuit.


If the current is entering into the positive terminal of battery then power is absorbed by the battery and if the current is entering into the negative terminal of battery then power is delivered by the battery.                              



Read more ...

Reciprocity Theorem or Reciprocal Theorem

RECIPROCAL THEOREM



A network is said to be reciprocal if the network remains invariant due to the interchange of position of cause and effect.
Read more ...

Superposition Theorem

SUPERPOSITION  THEOREM

Superposition theorem states that for any linear network consisting of a number of sources,the overall response is equal to the algebraic sum of individual responses considering only one source at a time keeping all other sources inoperative.


Read more ...

Thevenin's Theorem

THEVENIN’S THEOREM

Thevenin’s theorem states that for any two terminal linear network consisting of a number of sources can be replaced by a single voltage source in series with an impedance.


Thevenin’s voltage is the open circuit voltage across the terminals where we want to find Thevenin’s equivalent. Thevenin’s impedance is the net impedance across the terminals where we want to find the Thevenin’s equivalent.
Read more ...

Sum of numbers using c program

In this tutorial we will discuss on how to find the sum of two numbers using c program.
For any c program the header file that must be included is stdio.h which stands for standard input output.

PROGRAM:

#include<stdio.h>
void main()
{
int a,b,sum;
printf(“Enter two numbers \n”);
scanf(“%d%d”,&a,&b);
sum=a+b;
printf(“Sum of two numbers is %d”,sum);
}



OUTPUT:

Enter two numbers
2 3

Sum of two numbers is 5
Read more ...

DC Machines| DC motor | DC generator


A machine that converts mechanical power to electrical power is known as a generator.The basic principle of a generator whether ac or dc is Faraday’s laws of electromagnetic induction.

The law states that whenever the magnetic flux linked with a conductor changes, an emf is induced in it and the direction of induced emf is given by Lenz law.

Learn about construction of dc machine

For a dc generator the direction of induced emf is given by Flemmings Right Hand rule.
Read more ...

Construction of DC Machine

CONSTRUCTIONAL DETAILS OF A DC MACHINE

In this section, we will be talking about the main parts used in dc machines.

  • ·         An armature consisting of a number of conductors suitably placed and connected so as to form a closed loop. Generally armatures are the rotating part of a machine and is termed as rotor.An armature is a cylindrical body rotating in space between the north and south pole comprising of slots,teeth,core and windings inside slots.

  • ·         A field system to produce the required magnetic field.It is usually the stationary part in a machine and is termed as stator. It consist of pole body,pole shoe and field windings.

  • ·         The stator and rotor are separated by a small air gap which forms the main criteria for determining the efficiency of a machine.

  • ·         A commutator consisting of a large number of segments which are well insulated from each other.

  • ·         Commutating poles or interpoles which are inter-posed between the main poles to ensure sparkless operation of the brushes at the commutator under the loaded conditions of machines.

  • ·         Yoke which acts as a mechanical support and as a path for the magnetic flux to flow.

  • ·         Brushes to collect the current from the rotating commutator or to lead current towards it in case of dc motor.

  • ·         Bearing-to support the rotating parts and to allow smooth motion with little friction .

  • ·         Arrangement of cooling-To keep the machine protected from heating up.


Read more ...

Upper case String to Lower case string

/* C Program - Convert Uppercase String to Lowercase */
  
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
  clrscr();
  char str[20];
  int i;
  printf("Enter the String (Enter First Name) in uppercase : ");
  scanf("%s",str);
  for(i=0;i<=strlen(str);i++)
  {
     if(str[i]>=65 && str[i]<=92)
     {
  str[i]=str[i]+32;
     }
  }
  printf("\nThe String in Lowercase = %s",str);
  getch();
}

Concept 

ASCII code of A is 65 and ASCII code of Z is 92.
ASCII code of a is 97 and Ascii code of z is 122.
Read more ...

Search an element in an array

#include<stdio.h>
void main() {
   int a[30], ch, num, i;
   printf("\nEnter no of elements :");
   scanf("%d", &num);
   printf("\nEnter the values :");
   for (i = 0; i < num; i++) {
      scanf("%d", &a[i]);
   }
   //Read the element to be searched
   printf("\nEnter the elements to be searched :");
   scanf("%d", &ch);
   //Search starts from the zeroth location
   i = 0;
   while (i < num && ch != a[i]) {
      i++;
   }
   //If i < num then Match found
   if (i < num) {
      printf("Number found at the location = %d", i + 1);
   } else {
      printf("Number not found");
   }
Read more ...

Matrix addition,multiplication and substraction using c program

    /*  MATRIX ADDITION, SUBTRACTION AND MULTIPLICATION  */

#include<stdio.h>
#include<conio.h>
void main()
 {
   int i,j,c,r,k;
   int a[20][20],b[20][20],ma[20][20],ms[20][20];
   int mm[20][20];
   clrscr();
   printf("\n\t\tINPUT:");
   printf("\n\t\t------");
   printf("\n\t\tEnter the value for row and column:  ");
   scanf("%d%d",&c,&r);
   printf("\n\t\tEnter the value for matrix A\n");
   for(i=0;i<c;i++)
     {
       for(j=0;j<r;j++)
        {
         scanf("%d",&a[i][j]);
        }
       printf("\n");
     }
   printf("\n\t\tEnter the value for matrix B\n");
   for(i=0;i<c;i++)
     {
       for(j=0;j<r;j++)
        {
          scanf("%d",&b[i][j]);
        }
       printf("\n");
     }
   for(i=0;i<c;i++)
     {
       for(j=0;j<r;j++)
         {
          ma[i][j]=a[i][j]+b[i][j];
          ms[i][j]=a[i][j]-b[i][j];
         }
     }
   for(i=0;i<c;i++)
     {
       for(j=0;j<r;j++)
         {
           mm[i][j]=0;
           for(k=0;k<c;k++)
             {
               mm[i][j] +=a[i][k]*b[k][j];
             }
         }
     }
   printf("\n\t\tOUTPUT:");
   printf("\n\t\t-------");
   printf("\n\t\tThe addition matrix is:\n");
   for(i=0;i<c;i++)
     {
       for(j=0;j<r;j++)
         {
          printf("\t\t%d",ma[i][j]);
         } 
       printf("\n");
     }
   printf("\n\t\tThe subtraction matrix is:\n");
   for(i=0;i<c;i++)
     {
       for(j=0;j<r;j++)
         {
           printf("\t\t%d",ms[i][j]);
         }
       printf("\n");
     }
   printf("\n\t\tThe multiplication matrix is:\n");
   for(i=0;i<c;i++)
     {
       for(j=0;j<r;j++)
         {
           printf("\t\t%d",mm[i][j]);
         }
       printf("\n");
     }
   getch();
 }


INPUT:
------
Enter the value for row and column:  2   2
Enter the value for matrix A
4   3
6   2
Enter the value for matrix B
8   1
0   5

OUTPUT:
-------
The addition matrix is:
          12   4
          6    7
The subtraction matrix is:
          -4   2
           6  -3
The multiplication matrix is:
           32  19


           48  16
Read more ...

Find mean,median and mode using c program


#include<stdio.h>
main()
{
int i,j,a[20]={0},sum=0,n,t,b[20]={0},k=0,c=1,max=0,mode;
float x=0.0,y=0.0;
printf("\nEnter the limit\n");
scanf("%d",&n);
printf("Enter the set of numbers\n");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
sum=sum+a[i];
}
x=(float)sum/(float)n;
printf("Mean\t= %f",x);

for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(a[i]>a[j])
{
t=a[i];
a[i]=a[j];
a[j]=t;
}
}
}
if(n%2==0)
y=(float)(a[n/2]+a[(n-1)/2])/2;
else
y=a[(n-1)/2];
printf("\nMedian\t= %f",y);

for(i=0;i<n-1;i++)
{
mode=0;
for(j=i+1;j<n;j++)
{
if(a[i]==a[j])
{
mode++;
}
}
if((mode>max)&&(mode!=0))
{
k=0;
max=mode;
b[k]=a[i];
k++;
}
else if(mode==max)
{
b[k]=a[i];
k++;
}
}
for(i=0;i<n;i++)
{
if(a[i]==b[i])
c++;
}
if(c==n)
printf("\nThere is no mode");
else
{
printf("\nMode\t= ");
for(i=0;i<k;i++)
printf("%d ",b[i]);
}
}

Read more ...

Convert a square matrix to Lower and Upper Triangular Matrix

Upper and Lower triangle Matrix Using C program In this program we will be discussing on how to convert a square matrix into correspon...