Dear Eric,
I do appreciate your help very much and your persistence on insisting for clarity. Please see below:
"Oh, well then I've completely misunderstood where the problem is.
Look you posted this:
f1[a_] := a[[1]] (1 - a[[2]]) + a[[2]] - a[[2]]^2;
f2[a_] := a[[1]] - 0.5 a[[1]]^2 + 2 (1 - a[[1]]) a[[2]];
av0 = {1., 1.};
varex = Table[av[i][t], {i, 2}];
eqnlist = {Derivative[1][av[1]][t] == f1[varex],
Derivative[1][av[2]][t] == f2[varex], av[1][0] == av0[[1]],
av[2][0] == av0[[2]]};
solDEsuper = NDSolve[eqnlist, varex, {t, 0, 1.4}]
and said that it worked."
My bad, that IS confusing. I meant it worked in this example and didn't give an error. It will not work in my actual problem, because in my actual problem I can't have the RHS of eqnlist be given as an analytic function of the arguments, as in what f1 and f2 are doing.
"I posted this:
avInit = {1, 1};
avFns = Array[av, 2];
avFnsApplied = Through[avFns[t]];
avProtoList[a_List] :=
0.5 (1 - a[[2]]) a[[1]]^2 + (1 - a[[1]]) a[[2]]^2 +
a[[1]] a[[2]];
avProto[args___] := avProtoList[{args}];
g1 = Derivative[1, 0][avProto];
g2 = Derivative[0, 1][avProto];
eqnlist = {Derivative[1][av[1]][t] == g1 @@ avFnsApplied,
Derivative[1][av[2]][t] == g2 @@ avFnsApplied,
av[1][0] == avInit[[1]], av[2][0] == avInit[[2]]};
solDEsuper = NDSolve[eqnlist, avFnsApplied, {t, 0, 1.4}]
and you said that it didn't work."
It didn't work for my actual problem for the same reason the previous didn't work. I tried the Real hack for this code and it produced an error (as it did for my examples with lists), but maybe I didn't do it right.
"When I look at eqnlist for each of them, I can't tell the difference. I thought if we used a simpler function, I could see the difference by inspection. But you don't want to provide a simpler function. Fine, just tell me what's different about these two. I'm sorry that I'm just not picking up on it, but that's where we are."
There is no difference for any function. Coming up with a simple yet non-analytic in terms of its variables function has eluded me, though I haven't tried very hard. Perhaps there are other ways to deal with this besides what has worked for me without lists (the Real hack--also other conditionals on the variables that leave the function unevaluated until its arguments are non-symbolic, like NumberQ)
"But then later, I forced you to tell me whether that expression was correct or not, and you said that it wasn't. So, I thought the problem was in generating eqnlist, and that maybe you could indicate the difference by giving me a reference. But now you seem to be saying that you don't know what eqnlist should even look like, you just know it's wrong. Okay, that's fair, but now we're talking about a mathematics problem, not a programming problem. So, you'll have to lead me through the mathematics before I can provide the code."
You can see what a good eqnlist should look like for either the simple file I initially posted or the more complicated ones that came later. Just type eqnlist in a separate cell after evaluating one of the cells that produced errors (because they had lists and the Real hack) or the ones that had the real hack, no lists and did not produce errors. Or take the semicolon out after the definition of eqnlist. It is something that has derivatives in it on the RHS of the equations, as opposed to explicit expressions in terms of the NDSolve variables.
"Now, you probably think I'm being stupid, and you'll say "no, no, that's not what I said/meant", and that's totally fine. Communication is hard. But I, as of right now, have no idea what/where the problem is. I know that for you, the problem is something about whether arguments are passed as a sequence or as a list. To me, that's a trivial problem, and I'm extremely confident that I can solve it. But I've been failing to produce a good result even though it seems to match the good results you've previously given me. It sounds like you're getting "good answers" with sequences, so I'm just trying to pin down what a good answer is."
It's a combination of TWO things. One is lists vs Sequence. The other is a function that can be algebraically written in terms of its arguments vs one that cannot. I want to deal with both simultaneously. I have a solution to either one by itself, but not when both are combined.
"So, at the end of the day, it sounds to me like we'd like to feed some inputs into NDSolve. We've got to generate those inputs somehow. You seem to be able to recognize when those inputs are good or not. I don't seem to be able to figure that part out. Also, I'm not really sure where we're starting here. It sounds like there are things "before" we start defining f, f1, etc. I know in your real world problem, those things are big and complicated, but in our toy problem, I would think you could give them to me explicitly. So, my brain is saying, "if he gives me the uber inputs, A, and then the inputs to NDSolve, B, then I can figure out how to transform A into B"."
The uber inputs would be a function that is not able to be written down explicitly in terms of its arguments (which also happen to be lists). The eigenvalue of a rank 5 matrix would be the simplest one I can think of. Or maybe a function defined implicitly as a solution to an equation that can only be solved numerically. But you can also look at the bigger files without having to reverse engineer them, just look at ffoutsuper as a black box function that is not possible to evaluate symbolically in terms of its arguments. Barring that, just make something work that uses the Real, or NumberQ hack as a conditional for one of the arguments to f. Or find some way to keep eqnlist without evaluating f or its derivatives. Or find a way to do what I was proposing at the beginning of this thread: take a list, turn it to a sequence before passing to f, then reconstruct it inside f, so that I can pass lists to other functions that I call from within f.
"If you can tell me where I'm going wrong in any of the above thinking, that would help greatly. If you can give me any concrete examples that I can compare to at any point in the computation, that would help greatly. If you can try different words to explain your intent, that might help."
I tried. I appreciate you trying to understand what I wrote and asking more questions if need be.