MATLAB Analysis and PSpice Simulation of an OP amp Circuit

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 พ.ย. 2024

ความคิดเห็น • 7

  • @WonYYang
    @WonYYang  17 วันที่ผ่านมา

    The related MATLAB m-file and PSpice opj-files can be downloaded at
    kr.mathworks.com/matlabcentral/fileexchange/175020-matlab-analysis-and-pspice-simulation-of-an-op-amp-circuit.
    The files listed in my books can be downloaded at my portfolio webpage: wyyang53.github.io/myportfolio1/.
    %cir04e09_2.m
    clear, clf
    syms s Vis
    R1=500; R2=40; R3=1e3; R4=1e3; K=(R3+R4)/R3; C1=1e-3; C2=1e-3;
    sC1=s*C1; sC2=s*C2; K=(R3+R4)/R3;
    Y=[1/R1+sC1+1/R2 -1/R2-sC1*K; -1/R2 1/R2+sC2];
    Vs=Y\[Vis/R1; 0]; % Eq.(E4.8.3)
    Gs=subs(K*Vs(2),Vis,1) % Eq.(1): Transfer function
    % Transient (Time) response
    f1=1; w1=2*pi*f1;
    Vis=2*w1/(s^2+w1^2); % Input transform
    Vos=Gs*Vis; % Output transform Eq.(3)
    vo=ilaplace(Vos) % Inverse Laplace transform
    vo=ilaplace_my(Vos) % How about using my ILT function?
    t0=0; tf=6; N=600;
    t=t0+(tf-t0)/N*[0:N]; % Time vector for [0,6]sec
    vot=eval(vo); % Eq.(E4.9.3) with the time vector substituted for t
    subplot(221)
    plot(t,real(vot)), shg
    set(gca,'fontsize',9), set(gcf,'color','white')
    % Frequency response
    syms w
    Gw=subs(Gs,s,j*w)
    f=0.1:0.1:10;
    Gw_=eval(subs(Gw,w,2*pi*f));
    Gm=abs(Gw_); % Magnitude of frequency response
    Gph=rad2deg(angle(Gw_)); % Phase of frequency response
    Gw1=eval(subs(Gw,w,w1)); % Frequency response at w=w1
    Gw1m=abs(Gw1); % Magnitude at w1
    Gw1ph=angle(Gw1); % Phase[rad] at w1
    Gw1ph_deg=rad2deg(Gw1ph);
    subplot(222)
    plot(f,Gm, [f1 f1],[0 Gw1m],'m:')
    subplot(224)
    plot(f,Gph, [f1 f1],[0 Gw1ph_deg],'m:')
    fprintf('Gw(f) with f=%4.1f = %5.1f

  • @nshuang1009
    @nshuang1009 5 วันที่ผ่านมา

    Hi, Dr. Yang, the book is interesting. For circuit design and analysis, for example the preamp design for Mic, do you suggest Matlab/Simulink or Pspice? What's the different while simulating the circuit using Matlab or Pspice? Or what's the pros/cons using Matlab/Simulink to simulate the circuit? Thank you

    • @WonYYang
      @WonYYang  5 วันที่ผ่านมา

      1. MATLAB can be used for design, analysis, and simulation while PSpice for analysis and simulation, but not for design.
      2. MATLAB can easily repeat the same process with many different values of parameters while PSpice takes time to change the values of parameters that can be automated.
      3. Compared with MATLAB simulation, PSpice presents realistic models so PSpice simulation feels like a hardware experiment and I think, it is better for mistake-proofing.
      That is why I recommend performing PSpice simulation after MATLAB design/analysis.
      4. If you are professional, how about trying SLPS that is a co-simulation tool using PSpice together with MATLAB/Simulink? (resources.pcb.cadence.com/schematic-capture-and-circuit-simulation/system-level-design-with-pspice-and-matlab) Regrettably, I have no experience of using the tool since it is too expensive for me. I wish you to share your experience of using it in the future.
      Thanks for being interested in my book. (wyyang53.wixsite.com/mysite/publications)

  • @alessio8309
    @alessio8309 17 วันที่ผ่านมา

    Dear Mr. Yang,
    I am an electronic engineering student in Italy, and unfortunately, I am unable to obtain a copy of your book MATLAB for Digital Communications because it cannot be shipped here. Could you kindly advise me on how I might be able to access it?
    Thank you very much for your time and assistance.

    • @WonYYang
      @WonYYang  17 วันที่ผ่านมา

      1. The e-book can be bought for $45 at play.google.com/store/books/details?id=3homEAAAQBAJ&rdid=book-3homEAAAQBAJ&rdot=1.
      2. The hard copy can be bought directly from me by sending $110 through PayPal. If you send me (at wyyang53@naver.com) an email message, I will inform you of my PayPal account.
      FYI, I have several times shipped my book to Italy, e.g., Via Poccetti, ..., 50125 - FIRENZE, CASALECCHIO DI RENO, BO 40033, .. Sondrio, SO 23100, ..which costed me about $60. I don't know why the shipping cost to Italy is so expensive.
      I recommend you to buy the e-book version that is much cheaper.
      Thanks for being interested in my book.

    • @alessio8309
      @alessio8309 16 วันที่ผ่านมา +1

      @@WonYYang Perfect, I will proceed with the digital format, and later I will also purchase the DSP book, as I find your approach to explanations unique and highly educational. Thank you very much.

    • @WonYYang
      @WonYYang  16 วันที่ผ่านมา

      @@alessio8309 Thank you for recognizing the value of my book.