{"id":5573,"date":"2025-08-08T15:22:31","date_gmt":"2025-08-08T20:22:31","guid":{"rendered":"https:\/\/commons.princeton.edu\/josephhenry\/?page_id=5573"},"modified":"2025-08-08T15:25:33","modified_gmt":"2025-08-08T20:25:33","slug":"the-first-transatlantic-cable","status":"publish","type":"page","link":"https:\/\/commons.princeton.edu\/josephhenry\/the-first-transatlantic-cable\/","title":{"rendered":"Mathematica Code"},"content":{"rendered":"<p>Modified from <a href=\"https:\/\/commons.wikimedia.org\/wiki\/File:Telegrapher_equation.gif\">Jacopo Bertolotti:<\/a><\/p>\n<p>(*Find the dispersion relation for the Telegrapher&#8217;s equation*)<br \/>\nf = E^(I (k x &#8211; \\[Omega] t));<br \/>\nFullSimplify[D[f, {t, 2}] &#8211; v^2 D[f, {x, 2}] + b D[f, t] + c f]<\/p>\n<p>Solve[c + k^2 v^2 + (-I b &#8211; \\[Omega]) \\[Omega] == 0, \\[Omega]]<\/p>\n<p>(*Generate the animation*)<br \/>\nR0 = 1; L0 = 1; G0 = 0.1; C0 = 1;<\/p>\n<p>\\[Sigma] = 1; k0 = 5; b = R0\/L0 + G0\/C0; c = R0*G0\/(L0*C0); v =<br \/>\n1\/Sqrt[ L0* C0];<br \/>\ng = Sum[(E^(I k x) E^(-(k &#8211;<br \/>\nk0)^2\/(2 \\[Sigma]^2)) E^(-I \\[Omega] t)) \/. {\\[Omega] -&gt;<br \/>\nk v}, {k, 0, 15, 0.1}];<br \/>\ng2 = Sum[(E^(I k x) E^(-(k &#8211;<br \/>\nk0)^2\/(2 \\[Sigma]^2)) E^(-I \\[Omega] t)) \/. {\\[Omega] -&gt;<br \/>\n1\/2 (-I b + Abs[Sqrt[-b^2 + 4 c + 4 k^2 v^2]])}, {k, 0, 15, 0.1}];<br \/>\np1 = Table[<br \/>\nShow[Plot[Re[g], {x, -5, 50}, PlotStyle -&gt; {Orange, Thick},<br \/>\nPlotRange -&gt; {-25, 25}],<br \/>\nPlot[Re[g2], {x, -5, 50}, PlotStyle -&gt; {Black, Thick},<br \/>\nPlotRange -&gt; {-25, 25}], Axes -&gt; False,<br \/>\nPlotLegends -&gt; {&#8220;Wave eq.&#8221;, &#8220;Telegrapher&#8217;s eq.&#8221;}], {t, 0, 50, 0.5}];<br \/>\nListAnimate[p1, 10]<\/p>\n<p>*Still need to find proper RLGC values and length of simulation in proper units to be a good model<\/p>\n<p><strong>From <a href=\"https:\/\/www.wolfram.com\/mathematica\/new-in-10\/pdes-and-finite-elements\/solve-the-telegraph-equation-in-1d.html\">Mathematica Documentation<\/a>:<\/strong><\/p>\n<p>a = 0.7; b = 0.6; c = 1.1;<\/p>\n<p>f[x_] = D<sup class='footnote'><a href='#fn-5573-1' id='fnref-5573-1' onclick='return fdfootnote_show(5573)'>1<\/a><\/sup>, x];<br \/>\nvInit[x_] = -c*D[f[x], x] &#8211; (a + b) f[x]\/2;<\/p>\n<p>Plot[f[x], {x, -1, 1}, PlotRange -&gt; All]<br \/>\nPlot[vInit[x], {x, -1, 1}, PlotRange -&gt; All]<\/p>\n<p>uif = NDSolveValue[{D[u[t, x], {t, 2}] + (a + b) D[u[t, x], {t, 1}] &#8211;<br \/>\nc^2 D[u[t, x], {x, 2}] + a b u[t, x] == 0, u[0, x] == f[x],<br \/>\nDerivative[1, 0][u][0, x] == vInit[x],<br \/>\nDirichletCondition[u[t, x] == f[0], x == 0],<br \/>\nDirichletCondition[u[t, x] == f[1], x == 1]},<br \/>\nu, {t, 0, 2}, {x, 0, 1}];<\/p>\n<p>framesTEQ =<br \/>\nTable[Plot[uif[t, x], {x, 0, 1}, PlotRange -&gt; {-1, 1.3}], {t, 0, 2,<br \/>\n0.01}];<\/p>\n<p>Manipulate[framesTEQ[[i]], {{i, 3, &#8220;time&#8221;}, 1, Length[framesTEQ], 1},<br \/>\nSaveDefinitions -&gt; True]<\/p>\n<p>ListAnimate[framesTEQ, AnimationRate -&gt; 25, SaveDefinitions -&gt; True]<\/p>\n<p>&nbsp;<\/p>\n<div class='footnotes' id='footnotes-5573'>\n<div class='footnotedivider'><\/div>\n<ol>\n<li id='fn-5573-1'>125 Erf[(x &#8211; 0.5)\/0.125 <span class='footnotereverse'><a href='#fnref-5573-1'>&#8617;<\/a><\/span><\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Modified from Jacopo Bertolotti: (*Find the dispersion relation for the Telegrapher&#8217;s equation*) f = E^(I (k x &#8211; \\[Omega] t)); FullSimplify[D[f, {t, 2}] &#8211; v^2 D[f, {x, 2}] + b D[f, t] + c f] Solve[c + k^2 v^2 + (-I b &#8211; \\[Omega]) \\[Omega] == 0, \\[Omega]] (*Generate the animation*) R0 = 1; L0 &hellip; <a href=\"https:\/\/commons.princeton.edu\/josephhenry\/the-first-transatlantic-cable\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mathematica Code&#8221;<\/span><\/a><\/p>\n","protected":false},"author":6922,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-5573","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/commons.princeton.edu\/josephhenry\/wp-json\/wp\/v2\/pages\/5573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/commons.princeton.edu\/josephhenry\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/commons.princeton.edu\/josephhenry\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/commons.princeton.edu\/josephhenry\/wp-json\/wp\/v2\/users\/6922"}],"replies":[{"embeddable":true,"href":"https:\/\/commons.princeton.edu\/josephhenry\/wp-json\/wp\/v2\/comments?post=5573"}],"version-history":[{"count":5,"href":"https:\/\/commons.princeton.edu\/josephhenry\/wp-json\/wp\/v2\/pages\/5573\/revisions"}],"predecessor-version":[{"id":5624,"href":"https:\/\/commons.princeton.edu\/josephhenry\/wp-json\/wp\/v2\/pages\/5573\/revisions\/5624"}],"wp:attachment":[{"href":"https:\/\/commons.princeton.edu\/josephhenry\/wp-json\/wp\/v2\/media?parent=5573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/commons.princeton.edu\/josephhenry\/wp-json\/wp\/v2\/categories?post=5573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/commons.princeton.edu\/josephhenry\/wp-json\/wp\/v2\/tags?post=5573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}