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

Help in Mathematica

  1. Nov 30, 2013 #1
    Hello,I have a problem in writing my code in Mathematica, when I put values of R,T,S&a the system worked and gave me result but when I put the system in for loop , it gave me errors,I hope someone help me and thank you
     

    Attached Files:

  2. jcsd
  3. Nov 30, 2013 #2
    In your Untitled-8.nb

    Item 1: You have For[S = 6, S <= 6, S = s + 1 and that last "s" should probably be "S"

    Item 2: I think you need a ; between your m=NDSOLVE[...] and c=Det[...]

    Item 3: I think you have a misplaced ]. It looks like your innermost For[] does 11 different m=..., the For is finished and only the last result is saved in m AND THEN you do c=Det[.../.m]

    When I make all those changes with what I guess is correct then your error messages go away and I get very different output.
     
  4. Dec 7, 2013 #3
    problem in findroot

    Hello Mr Bill,thank you again for your help ,my new code is the same like before but with the change of the differential systems but I faced a problem when I used Findroot function,my system works but when I add the FindRoot Function the program did not response,so I hope to find the error in the Findroot function,and thank you again
     

    Attached Files:

  5. Dec 7, 2013 #4
    Mr Bill I tried to change the interval in the Find Root Function but I got errors,I hope to check them
     

    Attached Files:

  6. Dec 7, 2013 #5
    You are asking FindRoot to look for a root inside a specific interval and to fail if it cannot find a root in that interval. FindRoot looks, cannot find a root inside that interval and fails. The error message tells you that it failed to find a root in the interval that you require.

    You can try to change the interval. You can try to learn more about the function you are trying to solve and thus know better how to solve it. You can try plotting the function before you solve it and see how it behaves. Any and all these can help you understand how to get a correct answer.

    Have you and I been through this before? This seems very similar to a problem that I and someone, perhaps you, went over and over and over and over. We never seemed to be able to understand each other with that problem.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook