Tag Info

New answers tagged

1

Just a quick cigar-smoking interpretation to point you toward a more Mathematica flavored way. A bit cleaner (IMO), and much faster. Does not check for length <2, etc., so add that. With[{r = Range@Length@#, t = #, n = Length@# - 1}, DeleteDuplicates /@ Last@Reap[Scan[(Sow[Times @@ t[[#]], 1]; Sow[Times @@ t[[Complement[r, #]]]]) &, ...


1

Working with a new Mathematica session and cleaning up your code to pickTwoParts[parts_] := Module[{par1, par2, i}, If[Length[parts] < 2, Return[{{}, {}}]]; par1 = {}; par2 = {}; For[i = 1, i <= Length[parts], i++, Module[{pr1, pr2, j, result}, pr1 = parts[[i]]; pr2 = 1; For[j = 1, j <= Length[parts], ...


1

Check: Check[expr, failexpr] evaluates expr, and returns the result, unless messages were generated, in which case it evaluates and returns failexpr. Check[expr, failexpr, {s1::t1, s2::2, …}] checks only for the specified messages. Check[expr, failexpr, "name"] checks only for messages in the named message group. CheckAbort: ...


2

The solution to this problem was a simple one: BC1 was defined at [t,0], and BC2 was also defined at [t,0]. Change the location of BC2 to [t,2*L] and the problem is solved. I.e. both boundary conditions were defined for the same point.


3

I think there is enough information in the question to make a confident guess at the problem. The key clue is in the quoted error message: Nearest::neard: "The default distance function does not give a real numeric distance when applied to the point pair ...


1

As Fred Simons comments NIntegrate has the HoldAll attribute but alone that does not explain this behavior. With the literal assignment z = 1 no NIntegrate::nlim message prints: z = 1; NIntegrate[f[x], {x, 0, z}] Table normally works by the same mechanism as Block, and indeed we see the same behavior from Block: ClearAll[f, x, z] Block[{z = 1}, ...


2

From the comment by Stefan. Try renaming or deleting this file: FileNameJoin[{$UserBaseDirectory, "FrontEnd", "init.m"}]


3

The reason for the error message is that C is a reserved system symbol. http://reference.wolfram.com/language/ref/C.html Since C has the attribute Protected, no further definitions can be made for it. http://reference.wolfram.com/language/ref/Protected.html



Top 50 recent answers are included