I am trying to do some calculations on very long and difficult equations. Ultimately, I want to create a function to NIntegrate my result, but I want to set it as SetDelay (to be evaluated after placing the variables).
The problem can be showed at this simple example:
A = {{a, b}, {c, d}};
EVals = Eigenvalues[A];
EV1 = EVals[[1]];
EV2 = EVals[[2]];
DEV1 = D[EV1, a];
DEV2 = D[EV2, a];
F[b_, c_, d_] := NIntegrate[DEV1 + DEV2, {a, 0, 1}];
But after evaluation, e.g., F[2,3,4], I get the symbolic expression.
I know, that in this example I can just copy-paste DEV1
and DEV2
directly to the F
, but I am working with more difficult formulas, where I cannot do this.
NIntegrate::itraw: Raw object 1 cannot be used as an iterator.
. As you see in your code, you seta
to1
, and then you want to integrate over this, e.g. $\int_0^1 (DEV1+DEV2) \; \rm d 1$. This does not make much sense, right? :) So what do you want to do with thisa
? $\endgroup$F[b_,c_,d_] := NIntegrate[DEV1 + DEV2, {a, 0, 1}]
it still doesn't work. :( I corrected my question. $\endgroup$