{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 5: Non Linear Applications of IC OPamps" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.11: Triangular_wave_generator.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 5.11\n", "clc;clear;close;\n", "format('v',5);\n", "f0=1.5;//kHz\n", "Vopp=6;//V\n", "Vsat=13.5;//V\n", "//Let R2=10kohm\n", "R2=10;//kohm\n", "R3=R2*2*Vsat/Vopp;//kohm\n", "//Let C1=0.05 micro F\n", "C1=0.05;//micro F\n", "R1=R3/(4*f0*1000*R2*1000*C1*10^-6);//kohm\n", "disp(R3,R2,R1,'Values of R1, R2 & R3(kohm) are : ');\n", "disp(C1,'Value of C1(micro F)');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.12: Frequency_of_oscillation.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 5.12\n", "clc;clear;close;\n", "format('v',4);\n", "tau=1;//ms\n", "//R1/R2=1.8:9;given range\n", "//Let R1/R2=1.8\n", "R1BYR2=1.8;//ratio\n", "Beta1=1/(R1BYR2+1);\n", "R1BYR2=9;//ratio\n", "Beta2=1/(R1BYR2+1);//unitless\n", "Beta=Beta1:Beta2;//Range of Beta\n", "//For fmin\n", "Tmax=2*log((1+Beta1)/(1-Beta1));//ms\n", "fmin=1000/Tmax;//Hz\n", "//For fmax\n", "Tmin=2*log((1+Beta2)/(1-Beta2));//ms\n", "fmax=1/Tmin;//kHz\n", "disp('Frequency range is '+string(fmin)+' Hz to '+string(fmax)+' kHz');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.1: Find_VUT_and_VLT.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 5.1\n", "clc;clear;close;\n", "format('v',5);\n", "R1=100;//kohm\n", "R2=86;//kohm\n", "Vsat=15;//V\n", "VUT=R2/(R1+R2)*Vsat;//V\n", "VLT=R2/(R1+R2)*-Vsat;//V\n", "disp(VUT,'VUT(V) : ');\n", "disp(VLT,'VLT(V) : ');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.2: Period_of_multivbator_and_frequency.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 5.2\n", "clc;clear;close;\n", "Rf=100;//kohm\n", "C=0.1;//micro F\n", "T=2*Rf*1000*C*10^-6;//s\n", "disp(T*10^3,'Time period(ms)');\n", "f=1/T;//Hz\n", "disp(f,'Frequency(Hz) : ');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.3: Frequency_of_oscillation.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 5.3\n", "clc;clear;close;\n", "R=100;//kohm\n", "C=0.01;//micro F\n", "f=1/(2*R*10^3*C*10^-6);//Hz\n", "disp(f,'Frequency(Hz) : ');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.4: Design_a_square_wave_oscillator.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 5.4\n", "clc;clear;close;\n", "f=1*1000;//HZ\n", "Vs=15;//V\n", "C=0.1;//micro F(Assumed)\n", "R=1/(2*f*C*10^-6);//Hz\n", "disp(R/1000,'For the required design value of R(kohm) : ');\n", "disp('R1 & R2 can be choosen as 10 kohm');\n", "///Answer in the book is wrong" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.5: Maximum_diode_current.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 5.5\n", "clc;clear;close;\n", "Vo=0.7;//V\n", "Vsat=12;//V\n", "R1=10;//kohm\n", "R2=60;//kohm\n", "Vth=R1/(R1+R2)*Vo;//V\n", "iDmax=(Vsat-Vo)/R1-Vo/(R1+R2);//mA\n", "disp(iDmax,'Maximum current(mA) : ');\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.7: Frequency_of_oscillation.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 5.7\n", "clc;clear;close;\n", "format('v',6);\n", "R1=10;//kohm\n", "R2=16;//kohm\n", "C=10;//nF\n", "R=62;//kohm\n", "Beta=R1/(R1+R2);//unitless\n", "T=2*R*1000*C*10^-9*log((1+Beta)/(1-Beta));//seconds\n", "f=1/T;//Hz\n", "disp(f,'Frequency of oscillations(Hz) : ');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.8: Average_output_voltage.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 5.8\n", "clc;clear;close;\n", "format('v',5);\n", "//vo/v1=1+R2/R1;//\n", "//For v2/v1 i.e. gain=2, R1 & R2 should be equal\n", "Vpp=10;//V\n", "R1=10;//kohm\n", "R2=10;//kohm\n", "//Avg=1/T*integrate('Vpp*sin(2*%pi*t/T)','t',0,T/2);\n", "Avg=-Vpp/(2*%pi)*[cos(%pi)-cos(0)];\n", "disp(Avg,'Average output voltage(V) : ');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.9: Design_of_rectifier.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 5.9\n", "clc;clear;close;\n", "format('v',5);\n", "//vo/v1=-2;//Gain for -ve inputs\n", "voBYvi=-2;//Gain for -ve inputs\n", "//vo/v1=0;//Gain for non -ve inputs\n", "Rin=100;//kohm\n", "R1=100;//kohm(R1=Rin)\n", "R2=-R1*voBYvi;//kohm\n", "disp(R2,R1,'Values of R1 & R2(kohm) are : ');" ] } ], "metadata": { "kernelspec": { "display_name": "Scilab", "language": "scilab", "name": "scilab" }, "language_info": { "file_extension": ".sce", "help_links": [ { "text": "MetaKernel Magics", "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" } ], "mimetype": "text/x-octave", "name": "scilab", "version": "0.7.1" } }, "nbformat": 4, "nbformat_minor": 0 }