wolfram-mathematica

What is the minimal difference in RGB color values which Mathematica renders and exports as different colors?

笑着哭i 提交于 2020-02-02 03:57:05
问题 I was amazed when I found that Mathematica gives True for the following code (on 32 bit Windows XP with Mathematica 8.0.1): Rasterize[Graphics[{RGBColor[0, 0, 0], Disk[]}]] === Rasterize[Graphics[{RGBColor[0, 0, 1/257], Disk[]}]] What is the minimal difference in RGB color values which Mathematica renders and exports as different colors? Is it machine-dependent? 回答1: I believe this behaviour is machine dependent, but I do not know how exactly it depends on the OS. On my machine, it evaluates

Pattern matching Inequality

二次信任 提交于 2020-02-02 02:04:29
问题 I'd like to extract arguments from instances of Inequality. Following doesn't work, any idea why and how to fix it? Inequality[1, Less, x, Less, 2] /. Inequality[a_, _, c_, _, e_] -> {a, c, e} 回答1: Inequality[1,Less,x,Less,2] /. HoldPattern[Inequality[a_,_,b_,_,c_]] -> {a, b, c} Out: {1, x, 2} 回答2: Also, you can do this: Inequality[1, Less, x, Less, 2] /. Literal @ Inequality[ a_ , _ , c_ , _ , e_ ] -> {a, c, e} ADL 回答3: Why don't you use standard access to subexpression? expr = Inequality[1,

How to make the python code with two for loop run faster(Is there a python way of doing Mathematica's Parallelize)?

大憨熊 提交于 2020-01-24 15:36:08
问题 I am completely new to python or any such programming language. I have some experience with Mathematica. I have a mathematical problem which though Mathematica solves with her own 'Parallelize' methods but leaves the system quite exhausted after using all the cores! I can barely use the machine during the run. Hence, I was looking for some coding alternative and found python kind of easy to learn and implement. So without further ado, let me tell you the mathematical problem and issues with

Possible to use Mathematica from other programming languages (python/C#)?

♀尐吖头ヾ 提交于 2020-01-24 04:23:46
问题 Is it possible to use Mathematica's computing capabilities from other languages? I need to do some complex operations (not necessarily symbolic, btw), and it'd be pretty sweet to be able to just call Mathematica's functions or running Mathematica's code right from my python/c#'s program. Is it possible? 回答1: Looks like there is a MathLink API you can use from C#, c or Java, have you checked this out? http://reference.wolfram.com/mathematica/guide/MathLinkAPI.html 回答2: To links about usage of

Matlab cannot compute an infinite integral?

走远了吗. 提交于 2020-01-23 17:38:47
问题 I am studying Stochastic calculus, and occasionally we need to compute an integral (from -infinity to +infinity) for some complex distribution. In this case, it was with the answer on the right. This is the code I put into Matlab (and I have the symbolic math toolbox), which Matlab simply cannot process: >> syms x t >> f = exp(1+2*x)*(1/((2*pi*t)^0.5))*exp(-(x^2)/(2*t)) >> int(f,-inf,inf) ans = -((2^(1/2)*pi^(1/2)*exp(2*t + 1)*limit(erf((2^(1/2)*((x*1i)/t - 2i))/(2*(-1/t)^(1/2))), x, -Inf)*1i

How to enable Mathematica syntax highlighting for MediaWiki using extension “SyntaxHighlight GeSHi”?

江枫思渺然 提交于 2020-01-23 01:34:07
问题 I'd like to syntax highlight Mathematica code on a MediaWiki site. I've already installed the MediaWiki extension SyntaxHighlight GeSHi and verified that it works for other languages. I tried simply putting a Mathematica langauge data file mathematica.php into MediaWiki's extension path wiki/extensions/SyntaxHighlight_GeSHi/geshi , however it didn't correctly highlight a Mathematica code block such as: <syntaxhighlight lang="Mathematica"> (* this is a comment *) List[Sin[x], Cos[x], Tan[x]];

In Mathematica, what interpolation function is ListPlot using?

前提是你 提交于 2020-01-22 19:17:12
问题 [Screenshot below] I was using ListPlot to draw a smooth line through some data points. But I want to be able to work with the 1st and 2nd derivative of the plot, so I thought I'd create an actual "function" using Interpolation. But as you can see in the picture, it's not smooth. There are some strange spikes when I do Plot[Interpolation[...]...]. I'm wondering how ListPlot get's it's interpolated function, and how I can get the same thing, using Interpolation[] or some other method. thanks,

Return elements of the Groebner Basis as they are found

安稳与你 提交于 2020-01-22 19:17:11
问题 This question could refer to any computer algebra system which has the ability to compute the Groebner Basis from a set of polynomials (Mathematica, Singular, GAP, Macaulay2, MatLab, etc.). I am working with an overdetermined system of polynomials for which the full groebner basis is too difficult to compute, however it would be valuable for me to be able to print out the groebner basis elements as they are found so that I may know if a particular polynomial is in the groebner basis. Is there

Return elements of the Groebner Basis as they are found

ⅰ亾dé卋堺 提交于 2020-01-22 19:16:10
问题 This question could refer to any computer algebra system which has the ability to compute the Groebner Basis from a set of polynomials (Mathematica, Singular, GAP, Macaulay2, MatLab, etc.). I am working with an overdetermined system of polynomials for which the full groebner basis is too difficult to compute, however it would be valuable for me to be able to print out the groebner basis elements as they are found so that I may know if a particular polynomial is in the groebner basis. Is there

Is it safe to turn off Pattern::patv?

点点圈 提交于 2020-01-21 04:28:48
问题 By default Mathematica throws a warning message if I use the same name for both Blank and BlankSequence patterns: f[{x_, ___} | x__] := g[x] Pattern::patv: Name x used for both fixed and variable length patterns. >> Pattern::patv: Name x used for both fixed and variable length patterns. >> Yet the function works as I desire: f[{1, 2, 3}] f[1, 2, 3] g[1] g[1, 2, 3] Therefore, is it safe to use Off[Pattern::patv] and continue as I please? I am aware of a variety of different, more verbose