Clear Filters
Clear Filters

solving a circuit with multiple-objective optimization algorithm to find resistors and voltages values

6 views (last 30 days)
I have been tasked with optimizing the circuit parameters (R1, R2, R3, V1, and V2) to maximize power across a 2Ω resistor (Pmax) using both a single-objective optimization algorithm and a multiple-objective algorithm in MATLAB. The permissible values for resistors are between 0Ω and 5Ω, and for voltages between 0V and 10V. The optimization process should involve a population of 20 with 50 iterations.
For the single-objective optimization, I successfully employed the Genetic Algorithm to find R1, R2, R3, V1 and V2 when the power (P) is maximum over the 2Ω resistor. the power function over 2 resistor as a function of R1, R2, R3, V1 and V2 has been found
P2Ω = 2*((280*R1 + 200*R2 + 270*R3 + 100*V1 + 20*R1*R2 + 78*R1*R3 + 60*R2*R3 + 60*R1*V1 + 10*R1*V2 + 50*R2*V1 + 30*R3*V1 + 4*R1*R2*R3 + 5*R1*R2*V1 + 17*R1*R3*V1 + 2*R1*R3*V2 + 15*R2*R3*V1 + R1*R2*R3*V1 + 900)/(520*R1 + 450*R2 + 210*R3 + 45*R1*R2 + 149*R1*R3 + 135*R2*R3 + 9*R1*R2*R3 + 700) - (220*R1 + 795*R3 + 100*V1 + 53*R1*R3 + 10*R1*V1 + 45*R1*V2 + 30*R3*V1 + 2*R1*R3*V1 + 9*R1*R3*V2 + 2650)/(520*R1 + 450*R2 + 210*R3 + 45*R1*R2 + 149*R1*R3 + 135*R2*R3 + 9*R1*R2*R3 + 700))^2
After finding P2Ω I used Genetic algorithm to find R1, R2, R3, V1 and V2.
Now, I am seeking guidance on how to solve this problem with multiple-objective algorithm. Any help would be greatly appreciated.
  4 Comments
Torsten
Torsten on 21 Dec 2023
Edited: Torsten on 21 Dec 2023
Usually when you do multiobjective optimization, you have several objectives you have to consider which in general are in conflict with each other. This means an improvement in one objective means a deterioration in another objective. Are there goals in your application that compete with each other ? E.g. more use of energy means more damage to environment where you have to find a compromise ?
Or is it something that is described here that you are aiming at ?
Sam Chak
Sam Chak on 21 Dec 2023
I only know that to increase power,...
Since the power formula is given by , if both V and I have the same sign, then the maximum power is obtained by . Would you like to validate your calculation with the result from the optimization algorithm?"

Sign in to comment.

Answers (1)

Sam Chak
Sam Chak on 21 Dec 2023
Edited: Sam Chak on 22 Dec 2023
Update: This is not a complete solution, but it could serve as a starting point by applying Kirchhoff's Voltage Law, .
Additionally, I suggest calculating the power across the 2-ohm resistor using the formula , where represents the net current flowing through the resistor. Therefore, , and the goal is to maximize the cost .
Ideally, you should maximize and minimize , or vice versa. This is likely why your professor instructed you to perform multi-objective optimization. You need to formulate the Multi-objective Optimization Problem and solve it using the 'gamultiobj()' command, which is the multiobjective genetic algorithm function.
Loop 1
Loop 2
Loop 3
Loop 4
syms R1 R2 R3 V1 V2 I1 I2 I3 I4
eqns = [ V1 - 7*I1 + 4 - 2*(I1 - I3) == 0; % Loop 1
- 4 - R3*I2 + 3 - 5*(I2 - I4) == 0; % Loop 2
- R2*I3 - 2*(I3 - I1) - R1*(I3 - I4) + 5 == 0; % Loop 3
- R1*(I4 - I3) - 5*(I4 - I2) - 10*I4 + V2 == 0]; % Loop 4
vars = [I1; I2; I3; I4] % vector x
vars = 
[A, b] = equationsToMatrix(eqns, vars) % A·x = b
A = 
b = 
I'm unsure where to go from here. It is possible to set up the for-loop method to brute-force search for the best values in the specified search regions for , , , , . Perhaps, @Torsten can provide some advice.
Update 2: I didn't check your P2ohm equation, but this is likely how you derived the power equation from and .
x = linsolve(A, b);
x = simplify(x, 'steps', 100)
x = 
22/Dec/2023: @Moussa, Can you validate the GA result by making direct substitution of the values found for R1, R2, R3, V1, V2, and measure the power across the 2ohm resistor?
objfun = @costfun;
PopSize = 20;
MaxGens = 50;
nvars = 5;
A = - eye(nvars);
b = zeros(nvars, 1); % A*x <= b
Aeq = [];
beq = [];
lb = [0 0 0 0 0];
ub = [5 5 5 10 10];
nonlcon = [];
options = optimoptions(@ga,'PopulationSize', PopSize, 'MaxGenerations', MaxGens);
[x, fval] = ga(objfun, nvars, A, b, Aeq, beq, lb, ub, nonlcon, options)
ga stopped because it exceeded options.MaxGenerations.
x = 1×5
0 0 0.4999 10.0000 0
fval = -12.5000
%% R1 = 0, R2 = 0, R3 = 0.8789, V1 = 0.0585, V2 = 2.6896
function P2ohm = costfun(x)
R1 = x(1);
R2 = x(2);
R3 = x(3);
V1 = x(4);
V2 = x(5);
P2ohm = - (2*((280*R1 + 200*R2 + 270*R3 + 100*V1 + 20*R1*R2 + 78*R1*R3 + 60*R2*R3 + 60*R1*V1 + 10*R1*V2 + 50*R2*V1 + 30*R3*V1 + 4*R1*R2*R3 + 5*R1*R2*V1 + 17*R1*R3*V1 + 2*R1*R3*V2 + 15*R2*R3*V1 + R1*R2*R3*V1 + 900)/(520*R1 + 450*R2 + 210*R3 + 45*R1*R2 + 149*R1*R3 + 135*R2*R3 + 9*R1*R2*R3 + 700) - (220*R1 + 795*R3 + 100*V1 + 53*R1*R3 + 10*R1*V1 + 45*R1*V2 + 30*R3*V1 + 2*R1*R3*V1 + 9*R1*R3*V2 + 2650)/(520*R1 + 450*R2 + 210*R3 + 45*R1*R2 + 149*R1*R3 + 135*R2*R3 + 9*R1*R2*R3 + 700))^2);
end
  4 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!