Results 1 to 2 of 2

Math Help - help with NDSolve in mathematica

  1. #1
    Newbie
    Joined
    Nov 2009
    Posts
    1

    help with NDSolve in mathematica

    Hey All,

    I am trying to model a system of differential equations. I've formulated an equation, but am having trouble to get mathematica (version7) to provide me a (approximated) solution. Below is the code that I have:


    Code:
    crossAreaCyl = Pi*(3.075^2);
    aholetop = Pi*(.15875^2);
    aholebottom = Pi*(.2^2);
    g = 980;
    h0top = 90.678;
    h0bottom = 0.001;
    
    solution = NDSolve[
         {
        x'[t] == (-aholetop*Sqrt[2*g*(x[t] - y[t])])/crossAreaCyl,
                  
        y'[t] == ((aholetop*Sqrt[2*g*(x[t] - y[t])]) - (aholebottom *
              Sqrt[2*g*y[t]]))/crossAreaCyl,
           x[0] == h0top,
           y[0] == h0bottom},
         {x, y},
         {t, .1, 1}];
    When I run this, I get the following error twice:

    Code:
    NDSolve::mconly: For the method IDA, only machine real code is available. Unable to continue with complex values or beyond floating-point exceptions. >>
    The documentation doesn't seem to help me out in this case, unfortunately. Is there any help on how I can get any sort of solution?

    Thanks,
    Sam
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    Joined
    Aug 2008
    Posts
    903
    I got no error when I cut and pasted your code into ver. 7 and plotted the results with:

    Plot[Evaluate[{x[t], y[t]} /. solution], {t, 0.1, 1}]

    Often in Mathematica, a past variable assignment will conflict with a current assignment if you're not careful about variable names. A good idea to remember is when you have a problem and nothing looks wrong, cut the code out, stop Mathematica, re-start it, then paste it back in and see if that fixes the problem.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. help me in Mathematica
    Posted in the Math Software Forum
    Replies: 2
    Last Post: May 18th 2010, 01:26 AM
  2. Mathematica
    Posted in the Math Software Forum
    Replies: 2
    Last Post: March 24th 2010, 07:13 AM
  3. Mathematica Help
    Posted in the Math Software Forum
    Replies: 1
    Last Post: March 5th 2010, 07:12 AM
  4. Help pl. in NDSolve Mathematica expression
    Posted in the Math Software Forum
    Replies: 1
    Last Post: November 12th 2009, 07:40 AM
  5. Hamiltonian Systems with Mathematica's NDSolve
    Posted in the Calculus Forum
    Replies: 0
    Last Post: April 22nd 2008, 09:57 PM

Search Tags


/mathhelpforum @mathhelpforum