- Find out the value of ta (point at which source voltage is maximum i.e. V0)
- You are using both ta and t(a).
- In the else statement , you have written t(a) = t(k) which will make the exponent term equal to 1.
- You can't give conditional expression with else , use elseif.
Half Wave Diode Problem
조회 수: 4 (최근 30일)
이전 댓글 표시
![Screen Shot 2019-12-03 at 10.14.13 PM.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/252527/Screen%20Shot%202019-12-03%20at%2010.14.13%20PM.png)
![Screen Shot 2019-12-03 at 10.14.46 PM.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/252528/Screen%20Shot%202019-12-03%20at%2010.14.46%20PM.png)
This is a problem I have. Tried solving it but cant seem to figure it out. Am I on the right track?
C=input('What is C');
R=1800%omega;
V0=12%Volts;
f=60%Hz;
w=2*pi*f;
t=linspace(0,70,1000);
n=length(t);
VS=V0*sin(w*t);
VR=V0*sin(w*t(a))*exp(-(t-ta)/(R*C));
for k=1:n;
V(k)=V0*sin(w*t(k));
if VS(k)==VR(k);
iC=w*C*V0*cos(w*t(k));
iR=(V0*sin(w*t(k)))/R;
else VS(k)>=VR(k);
t(a)=t(k);
VR(k)=V0*sin(w*t(a))*exp(-(t(k)-ta)/(R*C));
end
end
figure(1);
plot(t,VR,'B- -',t,VS,'R-');
xlabel('Time (s)');
ylabel('Voltage (V)');
title('Voltage for AC to DC Converter');
legend('Voltage of resistor','Voltage of Source');
댓글 수: 0
답변 (1개)
Nishant Gupta
2019년 12월 18일
Few points to be noted:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Power Converters에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!