Results 1 to 5 of 5

Math Help - mathematica - why is this Do loop not producing any output?

  1. #1
    Newbie
    Joined
    Apr 2009
    Posts
    11

    mathematica - why is this Do loop not producing any output?

    Code:
    Clear[f]
    f[t_, i_] := (1000*20)/((1000 - 20)*E^(-(1 + 0.2 i)*t) + 20)
    Do[
     Plot[f[t, i], {t, 0, 3}, PlotRange -> {{0, 3}, {0, 1000}}],
     {i, 1, 10}]
    I was expecting 10 Plots to appear?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    May 2009
    Posts
    2
    It's a long story. The practical upshot is that you could try this

    Code:
    Clear[f]
    f[t_, i_] := (1000*20)/((1000 - 20)*E^(-(1 + 0.2 i)*t) + 20)
    Do[Print[Plot[f[t, i], {t, 0, 3}, 
       PlotRange -> {{0, 3}, {0, 1000}}]], {i, 1, 10}]
    Best Wishes,
    Mike
    www.walkingrandomly.com
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Apr 2009
    Posts
    11
    Quote Originally Posted by MikeCroucher View Post
    It's a long story. The practical upshot is that you could try this
    haha, I am interested?

    I got that example out of a tutorial for mathematica, which might been an earlier version so it would seem that they have changed the behaviour

    T.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    May 2009
    Posts
    2
    The tutorial you copied it from is almost certainly pre v6.0. Wolfram changed the graphics model completely when they moved to version 6 and most of the time the only thing you'll notice is that plotting is massively better.

    Sometimes though, the changes break old code and this is one of those times. More details can be found in the following mathform thread

    MathGroup Archive: June 2007 [01202]

    Cheers,
    Mike
    www.walkingrandomly.com
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Apr 2009
    Posts
    11
    Quote Originally Posted by MikeCroucher View Post
    Sometimes though, the changes break old code and this is one of those times. More details can be found in the following mathform thread

    MathGroup Archive: June 2007 [01202]
    Now that makes perfect sense, and it wasn't even a long story ;-)
    Cheers,

    Tom
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. need an integer producing function
    Posted in the Algebra Forum
    Replies: 5
    Last Post: November 19th 2010, 02:13 AM
  2. How to extract mathematica output
    Posted in the Math Software Forum
    Replies: 1
    Last Post: September 22nd 2010, 11:57 AM
  3. Mathematica: Converting output display for derivatives
    Posted in the Math Software Forum
    Replies: 2
    Last Post: August 7th 2009, 11:02 AM
  4. Cost of producing X units.....
    Posted in the Calculus Forum
    Replies: 3
    Last Post: July 6th 2009, 08:14 PM
  5. help producing eigenvlaues
    Posted in the Advanced Algebra Forum
    Replies: 3
    Last Post: October 14th 2008, 06:09 AM

Search Tags


/mathhelpforum @mathhelpforum