« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Advanced Hybrid and Differential Algebraic Equations
Transistor Amplifier Circuit
Model a transistor amplifier circuit that dispatches the voltage in a nonlinear fashion.
X
\!\(\* GraphicsBox[{ {AbsoluteThickness[1], StrokeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[None], LineBox[{{0.08750000000000002, 0.5513888888888889}, { 0.08750000000000002, 0.14027777777777772`}, { 1.2125000000000004`, 0.14027777777777772`}, { 1.2125000000000004`, 0.8875}, {0.46527777777777785`, 0.8875}, { 0.46527777777777785`, 0.5486111111111112}, {0.08472222222222225, 0.5486111111111112}, {0.08472222222222225, 0.5486111111111112}, {0.09027777777777779, 0.5486111111111112}}]}, {AbsoluteThickness[1], StrokeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[None], LineBox[{{0.4680555555555556, 0.5486111111111112}, { 0.6041666666666667, 0.5486111111111112}}]}, {AbsoluteThickness[1], StrokeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[None], LineBox[{{0.46527777777777785`, 0.5458333333333327}, { 0.46527777777777785`, 0.1458333333333326}}]}, {AbsoluteThickness[1], StrokeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[None], LineBox[{{0.6625000000000001, 0.5041666666666644}, { 0.6625000000000001, 0.14305555555555327`}}]}, {AbsoluteThickness[1], StrokeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[None], LineBox[{{0.6597222222222224, 0.8888888888888882}, { 0.6597222222222224, 0.6055555555555547}}]}, {AbsoluteThickness[1], StrokeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[None], LineBox[{{0.6069444444444445, 0.5513888888888883}, { 0.6597222222222223, 0.6069444444444441}}]}, {AbsoluteThickness[1], StrokeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[None], LineBox[{{0.6099960849616448, 0.549039553676881}, { 0.6651211183713481, 0.5013609470273878}}]}, {AbsoluteThickness[1], StrokeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[None], LineBox[{{0.6069444444444445, 0.576388888888888}, { 0.6069444444444445, 0.5208333333333324}}]}, {AbsoluteThickness[1], StrokeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[None], LineBox[{{0.8458333333333334, 0.5013888888888862}, { 0.8458333333333334, 0.14027777777777506`}}]}, {AbsoluteThickness[1], StrokeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[None], LineBox[{{0.6625000000000001, 0.5013888888888889}, { 0.8430555555555559, 0.5013888888888889}}]}, {AbsoluteThickness[1], StrokeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[None], LineBox[{{0.6597222222222223, 0.6041666666666661}, { 1.0319444444444448`, 0.6041666666666663}}]}, {AbsoluteThickness[1], StrokeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[None], LineBox[{{1.0319444444444448`, 0.5986111111111105}, { 1.0319444444444448`, 0.14305555555555505`}}]}, {AbsoluteThickness[1], StrokeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[None], CircleBox[{0.6222222222222227, 0.5513888888888882}, \ {0.040277777777777635`, 0.04166666666666685}]}, {AbsoluteThickness[1], GeometricTransformationBox[GraphicsGroupBox[ {GrayLevel[1], Opacity[1], GraphicsGroupBox[{ GeometricTransformationBox[ RectangleBox[{-0.033, 0.2368}, {0.033, 0.2632}], {{{1, 0}, {0, 1}}, {0., 0.}}], {GrayLevel[0], AbsoluteThickness[2], GraphicsGroupBox[{ GeometricTransformationBox[ LineBox[{{-0.066, 0.2632}, {0.066, 0.2632}}], {{{1, 0}, {0, 1}}, {0., 0.}}], GeometricTransformationBox[ LineBox[{{-0.033, 0.2368}, {0.033, 0.2368}}], {{{1, 0}, {0, 1}}, {0., 0.}}], {AbsoluteThickness[0.5], GeometricTransformationBox[{ LineBox[{ Offset[{-6, -12}, {0., 0.2368}], Offset[{-14, -12}, {0., 0.2368}]}], LineBox[{ Offset[{-6, 12}, {0., 0.2632}], Offset[{-14, 12}, {0., 0.2632}]}], LineBox[{ Offset[{-10, 16}, {0., 0.2632}], Offset[{-10, 8}, {0., 0.2632}]}]}, {{{1, 0}, {0, 1}}, {0., 0.}}]}}]}}]}], {{0.0888888888888888, 0.09583333333333366}}]}, {AbsoluteThickness[1], GeometricTransformationBox[GraphicsGroupBox[ {GrayLevel[1], Opacity[1], GraphicsGroupBox[{ GeometricTransformationBox[ RectangleBox[{-0.033, 0.2368}, {0.033, 0.2632}], {{{1, 0}, {0, 1}}, {0., 0.}}], {GrayLevel[0], AbsoluteThickness[2], GraphicsGroupBox[{ GeometricTransformationBox[ LineBox[{{-0.066, 0.2632}, {0.066, 0.2632}}], {{{1, 0}, {0, 1}}, {0., 0.}}], GeometricTransformationBox[ LineBox[{{-0.033, 0.2368}, {0.033, 0.2368}}], {{{1, 0}, {0, 1}}, {0., 0.}}], {AbsoluteThickness[0.5], GeometricTransformationBox[{ LineBox[{ Offset[{-6, -12}, {0., 0.2368}], Offset[{-14, -12}, {0., 0.2368}]}], LineBox[{ Offset[{-6, 12}, {0., 0.2632}], Offset[{-14, 12}, {0., 0.2632}]}], LineBox[{ Offset[{-10, 16}, {0., 0.2632}], Offset[{-10, 8}, {0., 0.2632}]}]}, {{{1, 0}, {0, 1}}, {0., 0.}}]}}]}}]}], {{1.2138888888888892`, 0.22083333333333344`}}]}, {GrayLevel[1], AbsoluteThickness[1], Opacity[1], GeometricTransformationBox[ GraphicsGroupBox[{ GeometricTransformationBox[ RectangleBox[{0.6839999999999999, 0.46699999999999997`}, \ {0.8160000000000001, 0.533}], {{{1, 0}, {0, 1}}, {0., 0.}}], {GrayLevel[0], AbsoluteThickness[2], GeometricTransformationBox[ LineBox[{{0.6839999999999999, 0.5}, {0.695, 0.533}, {0.717, 0.46699999999999997`}, {0.739, 0.533}, {0.761, 0.46699999999999997`}, {0.783, 0.533}, {0.805, 0.46699999999999997`}, {0.8160000000000001, 0.5}}], {{{1, 0}, {0, 1}}, {0., 0.}}]}}], {{{{0.0059889314503552326`, 0.716888169375565}, {-0.5818235443524734, 0.007379203103131768}}, {-0.27821356105332673`, 0.9021225011572342}}}]}, {GrayLevel[1], AbsoluteThickness[1], Opacity[1], GeometricTransformationBox[ GraphicsGroupBox[{ GeometricTransformationBox[ RectangleBox[{0.6839999999999999, 0.46699999999999997`}, \ {0.8160000000000001, 0.533}], {{{1, 0}, {0, 1}}, {0., 0.}}], {GrayLevel[0], AbsoluteThickness[2], GeometricTransformationBox[ LineBox[{{0.6839999999999999, 0.5}, {0.695, 0.533}, {0.717, 0.46699999999999997`}, {0.739, 0.533}, {0.761, 0.46699999999999997`}, {0.783, 0.533}, {0.805, 0.46699999999999997`}, {0.8160000000000001, 0.5}}], {{{1, 0}, {0, 1}}, {0., 0.}}]}}], {{{{0.007065459318993844, 0.7980684469716213}, {-0.6864080207849727, 0.008214822634796948}}, {0.060944459802721895`, 0.864865270937998}}}]}, {GrayLevel[1], AbsoluteThickness[1], Opacity[1], GeometricTransformationBox[ GraphicsGroupBox[{ GeometricTransformationBox[ RectangleBox[{0.6839999999999999, 0.46699999999999997`}, {0.8160000000000001, 0.533}], {{{1, 0}, {0, 1}}, {0., 0.}}], {GrayLevel[0], AbsoluteThickness[2], GeometricTransformationBox[ LineBox[{{0.6839999999999999, 0.5}, {0.695, 0.533}, {0.717, 0.46699999999999997`}, {0.739, 0.533}, {0.761, 0.46699999999999997`}, {0.783, 0.533}, {0.805, 0.46699999999999997`}, {0.8160000000000001, 0.5}}], {{{1, 0}, {0, 1}}, {0., 0.}}]}}], {{{{0.006848829464408586, 0.7568350400141252}, {-0.6653624718665793, 0.0077903914646766746`}}, {0.27755696900574234`, 0.8451266581675969}}}]}, {GrayLevel[1], AbsoluteThickness[1], Opacity[1], GeometricTransformationBox[ GraphicsGroupBox[{ GeometricTransformationBox[ RectangleBox[{0.6839999999999999, 0.46699999999999997`}, \ {0.8160000000000001, 0.533}], {{{1, 0}, {0, 1}}, {0., 0.}}], {GrayLevel[0], AbsoluteThickness[2], GeometricTransformationBox[ LineBox[{{0.6839999999999999, 0.5}, {0.695, 0.533}, {0.717, 0.46699999999999997`}, {0.739, 0.533}, {0.761, 0.46699999999999997`}, {0.783, 0.533}, {0.805, 0.46699999999999997`}, {0.8160000000000001, 0.5}}], {{{1, 0}, {0, 1}}, {0., 0.}}]}}], {{{{0.0070610450494687236`, 0.7147439421773384}, {-0.6859791753453274, 0.0073571317555061605`}}, {0.6664989117908965, 0.8594169267423541}}}]}, {GrayLevel[1], AbsoluteThickness[1], Opacity[1], GeometricTransformationBox[ GraphicsGroupBox[{ GeometricTransformationBox[ RectangleBox[{0.6839999999999999, 0.46699999999999997`}, \ {0.8160000000000001, 0.533}], {{{1, 0}, {0, 1}}, {0., 0.}}], {GrayLevel[0], AbsoluteThickness[2], GeometricTransformationBox[ LineBox[{{0.6839999999999999, 0.5}, {0.695, 0.533}, {0.717, 0.46699999999999997`}, {0.739, 0.533}, {0.761, 0.46699999999999997`}, {0.783, 0.533}, {0.805, 0.46699999999999997`}, {0.8160000000000001, 0.5}}], {{{1, 0}, {0, 1}}, {0., 0.}}]}}], {{{{0.006846622329646027, 0.7151727876169837}, {-0.6651480491467568, 0.007361546025031283}}, {0.10533419499982938`, 1.2562913749586637`}}}]}, {GrayLevel[1], AbsoluteThickness[1], Opacity[1], GeometricTransformationBox[ GraphicsGroupBox[{ GeometricTransformationBox[ RectangleBox[{0.6839999999999999, 0.46699999999999997`}, \ {0.8160000000000001, 0.533}], {{{1, 0}, {0, 1}}, {0., 0.}}], {GrayLevel[0], AbsoluteThickness[2], GeometricTransformationBox[ LineBox[{{0.6839999999999999, 0.5}, {0.695, 0.533}, {0.717, 0.46699999999999997`}, {0.739, 0.533}, {0.761, 0.46699999999999997`}, {0.783, 0.533}, {0.805, 0.46699999999999997`}, {0.8160000000000001, 0.5}}], {{{1, 0}, {0, 1}}, {0., 0.}}]}}], {{{{0.006415569755238068, 0.6743682260991328}, {-0.6232713740297924, 0.006941529124436133}}, {0.32189309852289416`, 1.219538321515682}}}]}, {AbsoluteThickness[1], GeometricTransformationBox[GraphicsGroupBox[ {GrayLevel[1], Opacity[1], GraphicsGroupBox[{ GeometricTransformationBox[ RectangleBox[{0.9339999999999999, 0.2368}, \ {1.066, 0.2632}], {{{1, 0}, {0, 1}}, {0., 0.}}], {GrayLevel[0], AbsoluteThickness[2], GeometricTransformationBox[{ LineBox[{{0.9339999999999999, 0.2632}, {1.066, 0.2632}}], LineBox[{{0.9339999999999999, 0.2368}, {1.066, 0.2368}}]}, {{{1, 0}, {0, 1}}, {0., 0.}}]}}]}], {{{{ 0.6458333333333334, 0.}, {0., 0.8974569319114026}}, { 0.19722222222222224`, 0.1134448910764746}}}]}, {AbsoluteThickness[1], GeometricTransformationBox[GraphicsGroupBox[ {GrayLevel[1], Opacity[1], GraphicsGroupBox[{ GeometricTransformationBox[ RectangleBox[{0.9339999999999999, 0.2368}, \ {1.066, 0.2632}], {{{1, 0}, {0, 1}}, {0., 0.}}], {GrayLevel[0], AbsoluteThickness[2], GeometricTransformationBox[{ LineBox[{{0.9339999999999999, 0.2632}, {1.066, 0.2632}}], LineBox[{{0.9339999999999999, 0.2368}, {1.066, 0.2368}}]}, {{{1, 0}, {0, 1}}, {0., 0.}}]}}]}], {{{{-0.006331395076749329, 0.8974138046410487}, {-0.6458022978286981, \ -0.008798174555300766}}, {0.07117594200475219, 1.2035543665407322`}}}]}, {AbsoluteThickness[1], GeometricTransformationBox[GraphicsGroupBox[ {GrayLevel[1], Opacity[1], GraphicsGroupBox[{ GeometricTransformationBox[ RectangleBox[{0.9339999999999999, 0.2368}, \ {1.066, 0.2632}], {{{1, 0}, {0, 1}}, {0., 0.}}], {GrayLevel[0], AbsoluteThickness[2], GeometricTransformationBox[{ LineBox[{{0.9339999999999999, 0.2632}, {1.066, 0.2632}}], LineBox[{{0.9339999999999999, 0.2368}, {1.066, 0.2368}}]}, {{{1, 0}, {0, 1}}, {0., 0.}}]}}]}], {{{{-0.0039955178360455085`, 0.8974397570591062}, {-0.6458209738632421, \ -0.005552214469989195}}, {0.6521669189320339, 1.2527626706068666`}}}]}, DiskBox[{0.4638888888888891, 0.55}, Offset[3.]], DiskBox[{0.6611111111111112, 0.6055555555555554}, Offset[{3., 3.0000000000001137`}, {0., 0.}]], DiskBox[{0.6638888888888891, 0.5}, Offset[3.]], DiskBox[{1.030555555555556, 0.5999999999999999}, Offset[{2.999999999999943, 3.0000000000001137`}, {0., 0.}]], DiskBox[{0.08611111111111125, 0.5472222222222223}, Offset[{2.999999999999943, 3.}, {0., 0.}]], {AbsoluteThickness[1], InsetBox[ StyleBox["\<\"\"\>", StripOnInput->False, LineColor->GrayLevel[0.2], FrontFaceColor->GrayLevel[0.2], GraphicsColor->GrayLevel[0.2], FontFamily->"Helvetica", FontSize->12, FontColor->GrayLevel[ 0.2]], {0.9222222222222225, 0.5000000000000001}]}, StyleBox[InsetBox[ StyleBox[ TagBox[ SubscriptBox["C", "1"], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[1.]], {0.276388888888889, 0.6347222222222231}, { Left, Baseline}, Alignment->{Left, Top}], FontSize->16], StyleBox[InsetBox[ StyleBox[ TagBox[ SubscriptBox["C", "2"], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {0.8597222222222225, 0.6736111111111116}, { Left, Baseline}, Alignment->{Left, Top}], FontSize->16], StyleBox[InsetBox[ StyleBox[ TagBox[ SubscriptBox["C", "3"], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {0.9013888888888892, 0.33194444444444504`}, { Left, Baseline}, Alignment->{Left, Top}], FontSize->16], InsetBox[ StyleBox[ TagBox[ StyleBox[ SubscriptBox["R", "1"], FontSize->16], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {0.36805555555555564`, 0.3430555555555559}, { Left, Baseline}, Alignment->{Left, Top}], InsetBox[ StyleBox[ TagBox[ StyleBox[ SubscriptBox["R", "2"], FontSize->16], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {0.3680555555555557, 0.7500000000000009}, { Left, Baseline}, Alignment->{Left, Top}], InsetBox[ StyleBox[ TagBox[ StyleBox[ SubscriptBox["R", "0"], FontSize->16], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {0.12638888888888888`, 0.45000000000000084`}, { Left, Baseline}, Alignment->{Left, Top}], InsetBox[ StyleBox[ TagBox[ StyleBox[ SubscriptBox["R", "3"], FontSize->16], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {0.6958333333333335, 0.34166666666666745`}, { Left, Baseline}, Alignment->{Left, Top}], InsetBox[ StyleBox[ TagBox[ StyleBox[ SubscriptBox["R", "4"], FontSize->16], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {0.7041666666666668, 0.7416666666666678}, { Left, Baseline}, Alignment->{Left, Top}], InsetBox[ StyleBox[ TagBox[ StyleBox[ SubscriptBox["R", "5"], FontSize->16], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {1.0680555555555558`, 0.3305555555555564}, { Left, Baseline}, Alignment->{Left, Top}], InsetBox["", {0.09027777777777779, 0.5986111111111114}, { Left, Baseline}, Alignment->{Left, Top}], InsetBox[ StyleBox[ TagBox[ StyleBox[ SubscriptBox["V", "1"], FontSize->14], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {0.056944444444444464`, 0.5791666666666673}, { Left, Baseline}, Alignment->{Left, Top}], InsetBox[ StyleBox[ TagBox[ StyleBox[ SubscriptBox["V", "2"], FontSize->14], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {0.4111111111111112, 0.5722222222222229}, { Left, Baseline}, Alignment->{Left, Top}], InsetBox[ StyleBox[ TagBox[ StyleBox[ SubscriptBox["V", "4"], FontSize->14], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {0.6083333333333334, 0.6222222222222229}, { Left, Baseline}, Alignment->{Left, Top}], InsetBox[ StyleBox[ TagBox[ StyleBox[ SubscriptBox["V", "3"], FontSize->14], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {0.6083333333333336, 0.4555555555555564}, { Left, Baseline}, Alignment->{Left, Top}], InsetBox[ StyleBox[ TagBox[ StyleBox[ SubscriptBox["V", "5"], FontSize->14], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {1.0388888888888892`, 0.6194444444444454}, { Left, Baseline}, Alignment->{Left, Top}], InsetBox[ StyleBox[ TagBox[ StyleBox[ SubscriptBox["V", "e"], FontSize->14], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {0.1694444444444444, 0.33888888888888946`}, { Left, Baseline}, Alignment->{Left, Top}], InsetBox[ StyleBox[ TagBox[ StyleBox[ SubscriptBox["V", "b"], FontSize->14], "RawBoxes"], FontFamily->"Helvetica", FontColor->GrayLevel[0.2], Background->GrayLevel[ 1.]], {1.0805555555555557`, 0.4583333333333339}, { Left, Baseline}, Alignment->{Left, Top}]}, ImageSize->{404.421875, Automatic}]\)
The input voltage varies sinusoidally. The circuit contains a transistor that modifies the voltage in a nonlinear way.
In[1]:=
X
ve[t_] := (4/10) Sin[200 Pi t]; v23[t_] = \[Beta] (Exp[(v2[t] - v3[t])/.026] - 1);
Use Ohm's law and Kirchoff's current law to determine the governing equations for each node.
In[2]:=
X
node1 = c1 (v2'[t] - v1'[t]) == v1[t]/r0 - ve[t]/r0; node2 = c1 (v1'[t] - v2'[t]) == (1 - \[Alpha]) v23[t] + v2 [t]/r1 + v2[t]/r2 - vb/r2; node3 = c2 v3'[t] == v23[t] - v3[t]/r3; node4 = c3 (v4'[t] - v5'[t]) == vb/r4 - v4[t]/r4 - \[Alpha] v23[t]; node5 = c3 (v4'[t] - v5'[t]) == v5[t]/r5; ics = {v1[0] == 0, v2[0] == vb/2, v3[0] == vb/2, v4[0] == vb, v5[0] == 0};
Specify the parameters associated with the circuit.
In[3]:=
X
params = {vb -> 6, r0 -> 1000, r1 -> 9000, r2 -> 9000, r3 -> 9000, r4 -> 9000, r5 -> 9000, \[Alpha] -> 99/100, \[Beta] -> 10^-6, c1 -> 10^-6, c2 -> 2 10^-6, c3 -> 3 10^-6};
Solve and visualize the system.
In[4]:=
X
transistorSol = NDSolve[{node1, node2, node3, node4, node5, ics} /. params, {v1, v2, v3, v4, v5}, {t, 0, 0.2}, Method -> {"EquationSimplification" -> "Residual"}, MaxSteps -> 100000] ;
In[5]:=
X
Plot[Evaluate[{v3[t], v4[t]} /. transistorSol], {t, 0, 0.2}, PlotRange -> All, ImageSize -> 400, PlotLegends -> {Style["Node 3", 14], Style["Node 4", 14]}, Frame -> True, FrameLabel -> {Style["Time", 18], Style["Voltage (V)", 18]}]
Out[5]=