hey everyone a friend of mine help me with an equation and it work fine just i try to change it a litle but im not able there is out put, R value and X. x axis here is R but i want to change it to X exaclt viceversa with what you are seein here
please help me with
%%% ====== input values =========
U = 12;
% R = 2; % change from R=0,1,2,3
L = [2200e-6; 2.9e-3; 3.8e-3]; % change from 0.0022 to 0.0045 in mH
frequency = 400; % in Hz, maybe 50Hz.
fi = pi/3;
Er = 8;
ksi = 0.1;
Xv = 2*pi*frequency*L; % ‘X’ is now vector ‘Xv’
r = [];
y = [];
Rv = 0:0.1:3; % ‘R’ is now vector ‘Rv’
figure
hold all
for k1 = 1:numel(Xv)
X = Xv(k1); % ‘X’ is an element of ‘Xv’ in each loop iteration
for k2 = 1:numel(Rv)
R = Rv(k2);
r(k1,k2) = R;
a = exp((R/X)*(pi/3));
k = R/X;
alfa = atan(X/R);
alfa1 = alfa*0.017;
output = -R*U*(1+a)^2*exp(-k*(fi-pi/3))/(3*X^2*(1+a^3))+Er*sin(fi-ksi-alfa1)/sqrt(R^2+X^2);
y(k1,k2) = output;
end
plot (r(k1,:), y(k1,:))
OutpLeg{k1} = sprintf('Output L = %.1f mH', L(k1)*1000);
end
hold off
legend(OutpLeg)
xlabel('R'), ylabel('output')
title('gragh R\_output')

답변 (1개)

moji abb
moji abb 2019년 10월 11일

0 개 추천

%%% ====== input values =========
U = 12;
% R = 2; % change from R=0,1,2,3
L = [2200e-6; 2.9e-3; 3.8e-3]; % change from 0.0022 to 0.0045 in mH
frequency = 400; % in Hz, maybe 50Hz.
fi = pi/3;
Er = 8;
ksi = 0.1;
Xv = 2*pi*frequency*L; % ‘X’ is now vector ‘Xv’
r = [];
y = [];
Rv = 0:0.1:3; % ‘R’ is now vector ‘Rv’
figure
hold all
for k1 = 1:numel(Xv)
X = Xv(k1); % ‘X’ is an element of ‘Xv’ in each loop iteration
for k2 = 1:numel(Rv)
R = Rv(k2);
r(k1,k2) = R;
a = exp((R/X)*(pi/3));
k = R/X;
alfa = atan(X/R);
alfa1 = alfa*0.017;
output = -R*U*(1+a)^2*exp(-k*(fi-pi/3))/(3*X^2*(1+a^3))+Er*sin(fi-ksi-alfa1)/sqrt(R^2+X^2);
y(k1,k2) = output;
end
plot (r(k1,:), y(k1,:))
OutpLeg{k1} = sprintf('Output L = %.1f mH', L(k1)*1000);
end
hold off
legend(OutpLeg)
xlabel('R'), ylabel('output')
title('gragh R\_output')

댓글 수: 8

darova
darova 2019년 10월 14일
What is the difference?
moji abb
moji abb 2019년 10월 14일
What I'm looking is to Chang plots in this code x axis is R value with difrent impedance I need same equation but vice versa x axis is impedance with difrent resistance value
darova
darova 2019년 10월 14일
What if just switch
% plot (r(k1,:), y(k1,:))
plot (y(k1,:), r(k1,:))
And change labels
ylabel('R'), xlabel('output')
moji abb
moji abb 2019년 10월 14일
thank you for respond not good enough to explain let me try again :
current plot is out put with 2 different value " l and R I JUST need to change setting for these two i point in attached file Y AXIS is output
Y AXIS IS value L " AND OUT PUT change with difrrent value of R1.jpg
darova
darova 2019년 10월 14일
Still unclear, can you please try again to explain?
moji abb
moji abb 2019년 10월 14일
sure i do my best
As you see in above code , I have an equation I need to find the out put of this equation with variable value of resistance and inductance , if you run the code you will see the Y AXIS IS OUT PUT AND X AXIS IS RESISTANCE , what I cant figure out is how to replace the place of resistance and inductance in plot. x axis is “R” but I should change it to “X” in simple language is I need to change the place of “R” AND “X” in plot
darova
darova 2019년 10월 14일
You mean letter? Label?
xlabel('X')
moji abb
moji abb 2019년 10월 14일
yes X label is inductance and other parameter with 3 difrent value is resistance

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

질문:

2019년 10월 11일

댓글:

2019년 10월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by