Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Higher Colleges of Technology

Sharjah Women’s College

EGN 2712: Applied Programing for Engineers

PROJECT WORK

TITLED:
MATLAB PROGRAM TO DETERMINE
ELECTRIC FIELD IN 2D

BY

Members’ Names: Members’ ID


Wafa Faisal Algahwi H00354185
Fatima Mohamad Hussein Ali H00354487
Fatima Khalid Mohamed Hussain H00353734

SUBMITTED ON
__________
Introduction

The purpose of this project is to enable students to build a MATLAB program that calculates
electric field at point P with coordinates x,y in space.
Electric field, an electric property associated with each point in space when charge is present in
any form. The magnitude and direction of the electric field are expressed by the value of E,
called electric field strength or electric field intensity or simply the electric field. Knowledge of the
value of the electric field at a point, without any specific knowledge of what produced the field, is
all that is needed to determine what will happen to electric charges close to that particular point.
An electronic color code is used to indicate the values or ratings of electronic components, usually
for resistors, but also for capacitors, inductors, diodes and others. A separate code, the 25-pair color
code, is used to identify wires in some telecommunications cables. Different codes are used for wire
leads on devices such as transformers or in building wiring.

Project Objective
Use MATLAB to program and scripts
The simplest type of MATLAB program is called a script. A script contains a sequence of commands
and function calls to understand the concept of an electric field qualitatively and quantitatively.
MATLAB provides a large number of functions that perform computational tasks, so it eases to
calculate the electric field at a point in space.
Methodology

Steps:

1- write the constant values for example the K=9*10^9.


2-write the equation and solve it.
3-write the code in MATLAB.
4-run the code to get the result.
5-solve in the paper to check the answer in the program.
6-get the final answer in MATLAB.

Algorithm development
C – program

k=9*10^9

prompt='enter x1 coordinate where field will be calculated';


x1=input(prompt)
prompt='enter y1 coordinate where field will be calculated';
y1=input(prompt)

prompt='Enter charge x2 coordinate';


x2 = input(prompt)
prompt='Enter charge y2 coordinate';
y2 = input(prompt)

r=y2-y1/x2-x1

prompt='enter charge value';


Q=input(prompt)

E=k*Q/r^2
Testing and results
Conclusion
In conclusion, we personally believe that this project helps us to Know about MATLAB program
and how we can deal with cods to solve equations of electrical field. Furthermore, The MATLAB
program helps Engineering student because it implementation of algorithms, creation of user
interfaces, and interfacing with programs written in other languages, including C, C++, C#, Java,
Fortran and Python. In addition, using MATLAB is not easy so we do a various background
research about MATLAB and how to use it to solve our electrical field equation. Moreover, after
the research we use steps to write code and calculate the Resultant Electric Field that clarifies how
MATLAB program can help us to solves equations by codes.

References
References
Britannica, T. E. (n.d.). Electric field. Retrieved from ENCYCLOPEDY BRITANNICA:
https://www.britannica.com/science/electric-field

You might also like