Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Mathematica HW 2

Shaun Panjabi
75387943
Part A) Differential Eqns
Finding our Vc[t] with regular Unit Step:
Clear@"Global`*"D
R = 1000; c = 1 * 10-12 ;
Vc@tD . DSolveB:Vc '@tD +

5 * UnitStep@tD

Vc@tD

Rc

Rc

Simplify

Out[536]=

5 I1 - -1 000 000 000 t M UnitStep@tD

, Vc@0D == 0>, Vc@tD, tF@@1DD

Next we find for when t < 0.5 ns

1010 * t

Vc@tD
In[540]:=

Vc1 = DSolveB:Vc '@tD +

Rc

, Vc@0D == 0>, Vc@tD, tF


Rc

F@t_D = Vc1@@1DD;

Out[540]=
Out[542]=

F@tD . 9t 0.5 * 10-9 =

99Vc@tD 10 -1 000 000 000 t I1 - 1 000 000 000 t + 1 000 000 000 1 000 000 000 t tM==
9VcA5. 10-10 E 1.06531=

When we plug in 0.5 ns our Vc is 1.07 Volts


"When t>0.5 ns"B
Vc@tD
Vc2 = DSolveB:Vc '@tD +

r*c

r*c

, VcA0.5 * 10-9 E 1.06531>, Vc@tD, tF Simplify F


500.-1.1012 t

Out[543]=

When t>0.5 nsB99Vc@tD 5. - 3.93469


Vs@t_D :=

10 * t 0 < t < 0.5


5
t 0.5

==F

DSolve@8Vc '@tD + Vc@tD Vs@tD, Vc@0D 0<, Vc@tD, tD Simplify H*Verify*L


Out[385]=

99Vc@tD

t0

- 10. + 10. -1. t + 10. t 0 < t


5. - 6.48721

Part B) Laplace Transform

-1. t

True

1
2

==

170b hw 2 final.nb

In[568]:=

Clear@"Global`*"D
R = 1000; c = 1 * 10-12 ;
Vs@t_D :=

10 * t 0 < t < 0.5 * 10-9


5

t 0.5 * 10-9

, Vc@0D 0>, Vc@tD, tF Simplify;


R*c
R*c
Vsrc@t_D := 10 t * IUnitStep@tD - UnitStepAt - 0.5 * 10-9 EM;
Vc@tD

DSolveB:Vc '@tD +

Vs@tD

ltf = LaplaceTransform@Vsrc@tD, t, sD;


Vc@s_D = Vc@tD . Solve@ltf Vc@tD + s * Vc@tD, Vc@tDD;
Out[575]=

"Vc@tD = "@InverseLaplaceTransform@Vc@sD, s, tDD Simplify

Vc@tD = A9- 10. I1. - 1. -1. t - 1. t + I- 1. + 1. -1. t + 1. tM HeavisideThetaA- 5. 10-10 + tEM=E

Part C) Using NDSolve

170b hw 2 final.nb

In[808]:=

Clear@"Global`*"D
Needs@"PlotLegends`"D
r = 1000;
c = 1 * 10-12 ;
, Vc@0D == 0>, Vc@tD, 9t, 0, 0.5 * 10-9 =F;
r*c
r*c
Vc2@tD
5
eqn2 = NDSolveB:Vc2 '@tD +

, Vc2A0.5 * 10-9 E 1.06531>,


r*c
r*c
1010 * t

Vc@tD

eqn = NDSolveB:Vc '@tD +

Vc2@tD, 9t, 0.5 * 10-9 , 5 * 10-9 =F;

p1 = PlotA8Vc@tD . eqn@@1DD<, 9t, 0, 0.5 * 10-9 =,

PlotRange 990, 5 * 10-9 =, 80, 5<=, PlotStyle 8Blue, Thick<E;

p2 = PlotA8Vc2@tD . eqn2@@1DD<, 9t, 0.5 * 10-9 , 5 * 10-9 =,

PlotRange 990, 5 * 10-9 =, 80, 5<=, PlotStyle 8Red, Thick<E;

p3 = PlotA1010 t, 9t, 0, 0.5 * 10-9 =, PlotStyle 8Purple, Thick<E;

p4 =
PlotA5 * UnitStepAt - 0.5 * 10-9 E, 9t, 0.5 * 10-9 , 5 * 10-9 =, PlotStyle 8Green, Thick<E;

ShowLegendB

Show@8p1, p2, p3, p4<, ImageSize 500,


8AxesLabel 8"tHsL", "Vc HVL"<<D,

::8Style@"", 12, BlueD, "t<t1=0.5 ns"<, 8Style@"", 12, RedD, "t>t1=0.5 ns"<,
:Style@"", 12, PurpleD, "10t

">, 9Style@"", 12, GreenD, "When t-0.5*10-9 "=>,


S
LegendPosition 80.8, - 0.4<, LegendShadow None,
Vc

LegendSize 80.6, 1<, LegendTextOffset 8- .5, 1<>F

Vc HVL
5

t<t1=0.5 ns

4
t>t1=0.5 ns

3
Out[818]=

Vc
10t
S
When t-0.5*10-9

1. 10-9

2. 10-9

Calculating Tpdelay and Trise

3. 10-9

4. 10-9

tHsL
5. 10-9

170b hw 2 final.nb

Clear@"Global`*"D
t = t . SolveA5 - 6.487 -1 000 000 000 t 0.5, tE;

t1 = t1 . SolveA5 - 6.487 -1 000 000 000 t1 4.5, t1E;


"rise ="@ t1 - tD
t2 = t2 . SolveA5 - 6.487 -1 000 000 000 t2 2.5, t2E
Out[739]=
Out[740]=
Out[741]=

"pdelay = " At2 - .22 * 10-9 EH*Seconds*L


rise =A92.19722 10-9 =E
99.53509 10-10 =

pdelay = A97.33509 10-10 =E

Part D) Convolution

In[505]:=

Clear@"Global`*"D
r = 1000;
c = 1 * 10-12 ;
"Vc@tD = " B

-J

IntegrateB1010 * *

Out[508]=

t-
r*c

, 9, 0, 0.5 * 10-9 =F + IntegrateB

Vc@tD = A5. - 8.24361 -1 000 000 000 t E

-J

-9

10

t-
r*c

, 9, 0.5 * 10-9 , t=FF

You might also like