Question
Please help me with this MATLAB problem. Thank you in advance! Ive got a circuit with two batteries, and Kirchoffs laws give me the equations
Please help me with this MATLAB problem. Thank you in advance!
Ive got a circuit with two batteries, and Kirchoffs laws give me the equations i1 + i2 = i3 V1 i1R1 i3R3 = 0 V2 i2R2 i3R3 = 0 The circuit has R1 = 10, R2 = 20, and R3 = 40. The first battery has a fixed voltage V1 = 40V , but the second battery can be adjusted to anything between 20V and 60V .
(a) Write a .m function file called circuit.m that takes V2 as an input and produces an array containing i1, i2, and i3 as an output. The function must use the backslash operator to solve the linear system.
(b) We want the current i3 to be 0.9A. We will find the V2 that produces this current by starting at V2 = 20V and incrementing V2 by 0.01V until we get i3 greater than or equal to 0.9A. Write a .m file called current.m that calls circuit.m inside a while loop in order to determine what voltage we should select for V2. When I run current.m, the correct V 2 should be printed to the screen.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started