Tag Info

New answers tagged

1

To answer the first question: ListAnimate[list] stores the list in the output, while Animate[code,...] stores only the code. Animate does not store the definitions of symbols referenced by code. If code is not self-contained, then the definitions will have to be executed before Animate will run properly. To answer the second question, which is also ...


2

I think I solved this problem. The error message was due to the fact that Mathematica cannot perform the internal integration, so I split the two integrations and used NIntegrate instead of the symbolic integration: p[z1_?NumericQ, R_?NumericQ, z_?NumericQ] := -NIntegrate[ BesselK[0, x/Ld]*x* ArcSin[(2*x)/( Sqrt[(z1)^2 + (x + 7.6)^2] + ...


0

TeXForm /@ {x^a, Sqrt@b, ArcSin[c]} // RowBox // DisplayForm $x^a\sqrt{b}\sin ^{-1}(c)$


0

You can probably prevent this from ever occurring by disabling the predictive interface itself. To do that, uncheck the setting Show Suggestions Bar after last output under Preferences > Interface (this is the first thing I do on a new install anyway).


5

The term incidence matrix has caused confusion on this site before, so I think it's time to clear this up. There's no standard, generally agreed upon definition of incidence matrix. It's a loose term for a matrix that describes the relationship (connections) between two different classes of objects. What these objects are can vary. When you see the term ...


4

The answer why it is not valid incidence matrix is given by the above answers. To verify if your matrix is valid, use the following command m = {{1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0}, {1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1}, {0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0}, {0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0}, {0, 1, 0, 0, 1, 0, 0, ...


4

The test matrices are matrices but not incidence matrices. The rows represent the vertices and each column represents an edge. Consequently each column must have only 2 non-zero entries or a single entry of 2 for self loops. This is not the case for any of the matrices or their transposes. To check for yourself, try yourself, e.g.: mat = ...


4

Sorry, but your matrices aren't valid incidence matrices. From the IncidenceMatrix help page: For an undirected graph, an entry $a_{ij}$ of the incidence matrix is given by: 0 if vertex $v_i$ is not incident to edge $e_j$ 1 if vertex $v_i$ is incident to edge $e_j$ 2 if vertex $v_i$ is incident to edge $e_j$ and a self-loop In ...


3

For the aid of anyone else who runs into this issue I seem to have figured out the compounding factors necessary to recreate this problem. Create a Windows directory C:\foo\bar Save arbitrary Notebook example.nb to this directory Using the Option Inspector add to NotebookPath exactly: "C:\\foo\\bar" Close and restart Mathematica Create a new Notebook and ...


2

You have several issues here. My oldest Mathematica here is version 8, but when I look at your compiled code: cf = Compile[{{x, _Integer}, {n, _Integer}}, z = (n^x); Binomial[n, #]*StirlingS2[x, #]*(#!)/z & /@ Range[x]]; << CompiledFunctionTools` CompilePrint[cf] I see that there are several callbacks from the compiled code to the ...


1

Like stated in the duplicate's link: functionexample[a_, b_, c_, x_] := Sin[a*x] + Cos[b*x] + Log[c*x] rootexample[a_, b_, c_, result_] := FindRoot[functionexample[a, b, c, x] == result, {x, 1, 12}, Method -> "Brent", PrecisionGoal -> 16][[1, 2]] a = 1; b = 1; c = 1; Quiet[Table[ Check[rootexample[a, b, c, i], "NaN", {FindRoot::bbrac}], {i, ...


0

You also need to restrict the input to be a positive integer. Since you are basically defining the factorial function, I have renamed it to factorial rather than fib. factorial::argv = "The argument `1` is not a positive integer."; factorial[n_] /; If[ TrueQ[Element[n, Integers] && n > 0], True, Message[factorial::argv, n]; False] := ...


3

The function Check is what you are looking for. fib[n_] := Check[If[n == 1, 1, n*fib[n - 1]], Print["n = ", n]; Abort[]] Block[{$RecursionLimit = 20}, fib[25]] $RecursionLimit::reclim: Recursion depth of 20 exceeded. >> n = 17 $Aborted


1

Just for completeness purposes: data = First@ToExpression@Import["http://pastebin.com/raw.php?i=8XKGYvSy", "Data"]; f = Interpolation[data] y[x_] := -3 Show@{Plot[{f[x], y[x]}, {x, Min[First /@ data], Max[First /@ data]}, PlotRange -> All], ListPlot[data, AxesOrigin -> {0, 0}, PlotRange -> All, PlotStyle -> Red]} Where you can see ...


1

Try this: data = ToExpression@ Import["http://pastebin.com/raw.php?i=8XKGYvSy", "Data"][[1]]; Interpolation[data]



Top 50 recent answers are included