| Author |
Comment/Response |
Bill Simpson
|
08/27/12 1:51pm
When I try to step through your code
You are missing some semicolons at the end of expressions. That is sometimes common for a new user or someone with experience in other programming languages. You can sometimes not end every expression with a semicolon, but that has been a source of errors and confusion for decades and I recommend always using semicolons, except for perhaps the last expression in a cell where you want the result displayed.
solveDiff[] gives a warning message about irrTime not having been given a (real) constant value. You are using NDSolve and everything must be constant numbers for that.
Then the second solveDiff gives a string of warning messages about not a list of replacement rules.
I realize you are trying to group your code into segments, but this appears to be breaking some things.
If I move your programMain down inside your For then the errors and warnings go away. You probably need to find a way to eliminate those yourself.
Then if I insert this
Print[n1List1];Print[n1List2];
just before your two ListPlot I see that the two lists are being created, but that all the entries are zero. That tells me that the error is probably in your AppendTo assignments to n1List1 and n1List2. So you are probably not correctly using your n10. I would put some Print statements around that and see if you can fix that. This will likely be complicated by your use of Module and using t as a local variable inside that. But that is where I would start
URL: , |
|