Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

ENGR 120 GC Defined Functions Matlab Paper

ENGR 120 GC Defined Functions Matlab Paper

Introduction

The purpose of this lab is to practice defining and using your own functions in MATLAB. For this exercise, we will be writing a circuit solver for three resistors in series:

Superposition4.PNG

Figure 1. Series Resistive Circuit

and three resistors in parallel:

parallel2.PNG

Figure 2. Parallel Resistive Circuit

Procedure

As usual, include a comment at the top explaining the purpose of the script, your name, and the date it was created.

  1. Create a main script called main.m. In this script, you will be:
    1. Creating three variables for three resistance values and a variable for the voltage source value. Be sure your variable names reflect what the variable is storing.
    2. Calling functions and storing output for computing the series and parallel equivalent resistances, and power.
    3. Communicating with the user.
  2. Create a function that computes the equivalent resistance for resistors in series. The function should take in as input the three resistance variables you defined in your main function and it should return as output the equivalent resistance. For series resistors, equivalent resistance is:

EquivalentResistance=R1+R2+R3…

EquivalentResistance=R1+R2+R3…

3. Create a second function that computes the equivalent resistance for resistors in parallel. The function should take in as input the three resistance variables you defined in your main function and it should return as output the equivalent resistance. For parallel resistors, equivalent resistance is:

EquivalentResistance=11R1+1R2+1R3...

EquivalentResistance=11R1+1R2+1R3...

4. Create a third function that computes current and power delivered by the voltage source. Your function should take in as input the equivalent resistance and return two outputs, current and power. Let equivalent resistance be denoted Req, then, current and power are:

Current=VoltageReq

Current=VoltageReq

Power=Current?Voltage

Power=Current?Voltage

5. Run two cases of your code and report to the user the results of your calculations. The test cases are:

Test Case 1: R1 = 120 Ohms, R2 = 230 Ohms and R3 = 250 Ohms. Voltage source = 10V.

Test Case 2: R1 = 25 Ohms, R2 = 70 Ohms and R3 = 100 Ohms. Voltage source = 9V.

Your communication should follow the format:

“For resistances 100 Ohm, 200 Ohm and 300 Ohms, the equivalent resistance in series is 600 Ohms.”

“For a 12V voltage source, the source current supplied is .02 Amps and the power supplied is .24 Watts.”

“For resistances 100 Ohm, 200 Ohm and 300 Ohms, the equivalent resistance in parallel is 54.545454 Ohms.”

“For a 12V voltage source, the source current supplied is .22 Amps and the power supplied is 2.64 Watts.”

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: School Assignment only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by School Assignment are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. School Assignment is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At School Assignment, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.