Tag Info

New answers tagged

1

Check that your Compiler setup is actually right. To see what your CCompiler setup is right now you should load the package CCompilerDriver via Needs["CCompilerDriver"] and execute CCompilers[], which you already did. In your case mathematica shows, that the compiler is set to MVS 2012 (this is version 11.0) not version 2013 (which would be version 12.0). To ...


2

Here is how you can do it using NestList and some code vectorization mat1[[1 ;; 2]] = Module[{ct = 1}, NestList[({{const1, const2}, {const3, const4}}.#) mat2[[1 ;; 2, ++ct]] &, mat1[[1 ;; 2, 1]], n - 1] //Transpose]; Assuming that the variables const1 to const4 have numerical values close enough to 1, e.g. const1 = 1.0; const2 = 0.9; const3 = ...


4

You have intermingled two separate syntaxes. N does not have a PrecisionGoal option, it just takes a precision argument (arguments are different from options in Mathematica). So either of the below methods will get something. And note that for NIntegrate one should also set WorkingPrecision to exceed PrecisionGoal. NIntegrate[Sqrt[1 + (x*Sin[x])^2], {x, ...


2

You can force Simplify to return inequalities with head Greater and right hand side 0 by adapting the ComplexityFunction and adding a transformation function that will convert a Less expression to a Greater expression: Simplify[a<0, ComplexityFunction->(If[#[[2]]===0 && Head[#]===Greater,1,1000] LeafCount[#1]&), ...


2

SeedRandom[42]; data = Flatten[Table[Table[Table[a + s RotationMatrix[b].{0, 1}, {s, 0, 10, 0.1}], {b, RandomReal[2 Pi, 5]}], {a, {{0, .1}, {1, 2}, {0.4, 0.2}, {1, 1}, {-2, 1}}}], 2]; res2 = Split[data, Norm[#1 - #2] < .2 &]; res == res2 (* res = SplitBy[data, Norm[f@# - #] < .2 &]; -- from belisarius' post *) (* True *) data2 = ...


2

You could do something like a flip-flop: ClearAll[f, h]; Module[{i = True}, h[_] := {}; f[x_] := (h[i = ! i] = x; If[# == {}, x, #] &@h[! i]) ] res = SplitBy[data, Norm[f@# - #] < .2 &]; ListPlot@Select[res, Norm[#[[1]]] < 1 &]


1

This is fixed for v10. In v10 there is also a PhaseRange option for BodePlot and NicholsPlot that can be used to override the default range (if you need to wrap it between $-\pi$ and $\pi$, etc). With[{τ1 = 20, τ2 = 2, τ3 = 0.4, τ4 = 0.05, τa = 10, τb = 1, k = 10}, Grid[Partition[Table[BodePlot[sys, PlotLabel -> sys, GridLines -> Automatic, ...


2

A very clear description of a Mathematica implementation of BW is given by Robert J Frey here. He seems to not have performance issues.



Top 50 recent answers are included