wolfram-mathematica

How to export ContourPlot3D surface and regenerate it in Excel, Originlab or some other similar softwares

£可爱£侵袭症+ 提交于 2020-01-03 10:44:09
问题 I tried this, but failed. fig3D = ContourPlot3D[ x^2 + y^3 - z^2 == 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, PlotPoints -> 100] pts = (InputForm@fig3D)[[1, 1, 1]]; ListSurfacePlot3D[pts] The regenerated surface is very poor. Any suggestions? thanks! 回答1: Not too bad if you specify MaxPlotPoints ListSurfacePlot3D[pts, Mesh -> None, MaxPlotPoints -> 100] Compare with ListSurfacePlot3D[pts] Edit Regarding the export to Excel, please consider that the Excel surface plot is a very basic construction

How to ragged partition a list in Python?

*爱你&永不变心* 提交于 2020-01-03 05:39:30
问题 Is there a built-in Python function such that with vals=[1,2,3,4,5] then foo(vals,2) gives [[1,2],[3,4],[5]] I am looking for the behaviour that Wolfram Language gives with Partition[Range@5, UpTo@2] {{1, 2}, {3, 4}, {5}} 回答1: This is built into neither the Python language itself nor its standard library, but might be what you are looking for functionality-wise: Install the third-party-library more-itertools (not to be confused with the itertools module, which is part of the Python standard

Can relative size changes be made to PointSize[], Thickness[] in mathematica?

喜夏-厌秋 提交于 2020-01-02 13:51:13
问题 Arising from this question regarding line thickness and point size setting [e.g. PointSize[Large} , PointSize[0.5] ), I was wondering if it is feasible to change PointSize[] , Thickness[] etc in a relative manner? I.e. why is it that PointSize[Larger] doesn't work? Or is possible to somehow query the existing pointsize and perhaps do something like PointSize[1.25*GetPointSize[]] (I haven't been able to figure this out if something like "GetPointSize[]" exists, neither with a quick look at the

Mathematica: Obtaining graphics primitives and directives

大兔子大兔子 提交于 2020-01-02 07:42:13
问题 How do you obtain graphic primitives and directives from a Graphics object? Leonid Shifrin showed how to remove them in the post Mathematica: Removing graphics primitives. I tried applying something similar but I can't get what I want. Consider this example: g1 = ListPlot3D[ {{0, -1, 0}, {0, 1, 0}, {-1, 0, 1}, {1, 0, 1}, {-1, 1, 1}}, Mesh -> {2, 2}, Boxed -> False, Axes -> False, ViewPoint -> {2, -2, 1}, ViewVertical -> {0, 0, 1}, MeshStyle -> RGBColor[0, 0.5, 0], BoundaryStyle -> RGBColor[1,

How do you set a global Abort handler?

ⅰ亾dé卋堺 提交于 2020-01-02 04:57:05
问题 In answering this question, I suggested that the OP open a stream at the beginning of his notebook and close it at the end. However, if an Abort is generated, the stream will be left open, and will cause havoc if they attempt to open it again without checking first. If the stream was only required for a single function, the solution would be straightforward, but it's required for the entire notebook. Obviously, a check can be added to see if the stream is already open, but is there a way to

Mathematica dynamic to plot matrix data

青春壹個敷衍的年華 提交于 2020-01-02 04:44:47
问题 I am trying to dynamically plot data contained in a matrix with Mathematica 7. The data is contained in it like this, obtained via a chemical model. [year H He Li C ... C8H14+,Grain- ] [0 0 0.03 0.009 1E-3 ... 0 ] [100 .1 0.03 0.009 1E-3 ... 0 ] [200 .2 0.03 0.009 1E-3 ... 0 ] [300 .2 0.03 0.009 1E-3 ... 0 ] [... ... ... ... ... ... ... ] [1E6 .5 0.03 0.003 1E-8 ... 1E-25 ] The truth is, the matrix dimensions are 2001*1476 (2000 steps and first line for name, and 1475 compounds + 1 column for

Is it possible to rename and block built-in functions temporarily?

前提是你 提交于 2020-01-02 04:44:09
问题 I wish to temporarily rename a built-in symbol and use it with different name while block the main name of this symbol. For example, I wish the following code to print only "2" but not "1" and "3": Block[{print = Print, Print}, Print[1]; print[2]; Print[3];] In really the above code prints nothing. Is it possible to make print working inside such code while completely block symbol Print ? Solutions like With[{Print = f, print = Print}, Print[1]; print[2]; Print[3];] are not suitable since

Understanding Trace*

允我心安 提交于 2020-01-02 04:29:45
问题 Good day, When trying to understand the Mathematica 's evaluation sequence by using standard Trace and TraceScan commands and their nice visual representations developed in the recent thread, I faced some ambiguities in their behavior. First of all, when I evaluate In[1]:= Trace[a+1,TraceOriginal->True] I get Out[1]= {a+1,{Plus},{a},{1},a+1,1+a,{Plus},{1},{a},1+a} All sublists correspond to sub-evaluations (as it is stated in the Documentation). The last expression 1+a probably corresponds to

Mathematica: Evaluation order during numerical optimisation of black box functions

大憨熊 提交于 2020-01-02 03:54:07
问题 I am attempting to perform a numerical optimisation of a "black box" function in Mathematica. Schematically it goes like this: NMinimize[{comb[x,y,z], x > 0}, {x,y,z}] where comb[x,y,z] is defined similarly to this: comb[x_,y_,z_] := Module[{}, Print[x,y,z]; M = FindMaximum[SkewNormal[a,x,y,z], {a,x}] // First; val = f[x,y,z,M]; Return[val]; ]; However, all of the minimisation functions I have tried seem to not immediately provide comb[x,y,z] with numerical values, and it ends up trying to

mathematica remote kernel on macs

僤鯓⒐⒋嵵緔 提交于 2020-01-02 03:46:25
问题 I am trying to run a remote mathematica kernel between two macs. Under Kernel Configuration Options For kernel program I have: /Applications/Mathematica.app/Contents/MacOS/MathKernel The arguments of MLOpen: -LinkMode Listen -LinkProtocol TCPIP -LinkOptions MLDontInteract The launch command is: java -jar mathssh username@xxxxxx.dynamic.uiowa.edu /usr/local/bin/math -mathlink -LinkMode Connect -LinkProtocol TCPIP -LinkName " linkname " -LinkHost ipaddress When i use this remote kernel (for