Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica Question

  1. Dec 1, 2005 #1
    Could someone tell me how to graph the following ODE's in Mathematica?:



  2. jcsd
  3. Dec 1, 2005 #2

    James R

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    I don't understand what you want to graph?

    Don't you need the solution first?
  4. Dec 2, 2005 #3


    User Avatar
    Science Advisor
    Homework Helper

    Can you solve them using Laplace Transforms first? That is:




    Edit: I tried using NDSolve in Mathematica. Having a problem with it as the first equation usually has the initial conditions both set to zero with the unit pulse at pi.
    Last edited: Dec 2, 2005
  5. Dec 2, 2005 #4


    User Avatar
    Science Advisor
    Homework Helper

    Well, I'm impressed. At Mathematica anyway. At first I thought it couldn't handle:

    [tex]\text{InverseLaplaceTransform}\left[\frac{e^{-\pi s}}{s^2+2s+2}\right][/tex]

    returning a complex expression but then I used:

    [tex]\text{Simplify[ComplexExpand[InverseLaplaceTransform}\left[\frac{e^{-\pi s}}{s^2+2s+2}\right]]][/tex]

    and it returned the correct value. Amcavoy, you gettin' all of this? Really would recommend to you to do all the work by hand first. Right? Just use the relations I gave above and you can invert that last expression by hand.

    Set the initial conditions for the first one to 0. As far as the second one, that u10 just ain't happening for me.

    Oh great, suppose you need another relation:


    where u(t) is the unit step function.
    Last edited: Dec 2, 2005
  6. Dec 2, 2005 #5
    Yeah I did solve them (I had some more too), but they looked too messy for me to "sketch" by hand so I wanted to see what they looked like in Mathematica. Thanks for the help :)
  7. Dec 2, 2005 #6


    User Avatar
    Science Advisor
    Homework Helper

    Well, this is the first one in Mathematica for y(0)=0, y'(0)=0:

    Code (Text):
    f[t_] :=
          If[t ≤  Pi,
              Return[Exp[-(t - Pi)] Sin[t - Pi]];
     Plot[f[x], {x, 0, 4 Pi}, PlotRange -> {{0, 4 Pi}, {-0.4, 0.4}}]
    Edit: Jesus, don't even need the 'Module' part.
    Last edited: Dec 2, 2005
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Similar Threads for Mathematica Question Date
Mathematica Simple Mathematica question Mar 23, 2015
Mathematica Quick Mathematica Question Oct 3, 2014
Mathematica : Pulling inputs from a function; methodology question. Jan 3, 2014
Mathematica derivation Question Sep 10, 2013
Mathematica question May 4, 2012