You are on page 1of 2

Scrip

%%REACTOR
clc; clear;
%{
n = x(1);
ri = x(2);
ro = x(3);
z = x(4);
%}
fitnessfcn = @FunObj1;
nvars = 4;
A = [0 1 -1 0];
b = [0];
LB = [10 2 3 5];
UB =[1000 100 300 500];
nonlcon = @resNoLin1;
IntCon = [1 4];
[x,fval,exitflag] = ga(fitnessfcn,nvars,A,b,[],[],LB,UB,nonlcon,IntCon);

Function: FunObj
function LongTot = FunObj1( x )
%UNTITLED6 Summary of this function goes here
%
Detailed explanation goes here
n = x(1);
ri = x(2);
ro = x(3);
z = x(4);
rMed = (ri + ro)/2;
LongMed = 2 * pi * rMed;
LongTot = LongMed * n;
end

function: reNoLin

function [ c,ceq ] = resNoLin1( x )


%UNTITLED5 Summary of this function goes here
%
Detailed explanation goes here

n = x(1);
ri = x(2);
ro = x(3);
z = x(4);
Lobj = 20e-3;
L = inductance(n,ri,ro,z);
%L = wheeler(n,ri,ro,z);
c = [L - Lobj; -L + Lobj];
ceq = [];
end

You might also like