wolfram-mathematica

How do you get custom 3D graphics to display properly in Mathematica?

时间秒杀一切 提交于 2019-12-18 16:52:30
问题 I need to incorporate a 3D model of the Earth into a satellite orbit intercept simulation I have created in Mathematica (I need it to work with "Graphics3D[]). I have downloaded several different models in formats that Mathematica claims to support and I even created my own in Pro/E. The ones that actually do get imported into the program (using "Import[]") lose their surface image and I am left with a generic sphere. How can I get custom 3D graphics to import correctly into Mathematica? Are

Aggregating Tally counters

安稳与你 提交于 2019-12-18 16:48:14
问题 Many times I find myself counting occurrences with Tally[ ] and then, once I discarded the original list, having to add (and join) to that counters list the results from another list. This typically happens when I am counting configurations, occurrences, doing some discrete statistics, etc. So I defined a very simple but handy function for Tally aggregation: aggTally[listUnTallied__List:{}, listUnTallied1_List, listTallied_List] := Join[Tally@Join[listUnTallied, listUnTallied1], listTallied]

mathematica start front end and eval notebook from command line

妖精的绣舞 提交于 2019-12-18 15:46:54
问题 Is there a way to start up a mathematica front end (GUI) from a (Windows) command prompt and have it eval a notebook without further user action? even though mathematica.exe takes the -run and -initfile options they dont work the same as they do with math.exe. (-run ''<<file.m'' wants to open a file named ''<<file.m'' for example) Thanks. The first answer looks promising, however I get FrontEndObject::notavail A front end is not available (per docs it is "UseFrontEnd" by the way.) Perhaps a

How to create a function directly from the output of Solve

让人想犯罪 __ 提交于 2019-12-18 13:15:59
问题 If I evaluate Solve[f[x,y]==0,x] , I get a bunch of solutions like: {{x -> something g[y]}, {x -> something else}} , etc. Now I want to convert each of those x->somethings into a function. Typically, my requirements are low, and my function f[x] is at the most a cubic, with straightforward solutions for x . So I've always just defined g1[y_]:=something , g2[y_]:=... etc, manually. However, for a function that I have now, Solve outputs a complicated polynomial running 4 pages long, and there

Find root of implicit function in Mathematica

徘徊边缘 提交于 2019-12-18 12:45:16
问题 Find root of implicit function in Mathematica I have an implicit function, for example: f(x,y) = x^3 + x*y + y^2 - 36 I want to find the root, ie solutions to the equation f(x,y) = 0 Drawing the solution is easy: ContourPlot[x^3 + x*y + y^2 - 36 == 0, {x, -2 Pi, 2 Pi}, {y, -3 Pi, 3 Pi}] however I would like to have the data that is in the plot and not only the visual plot. So how do I find the data of the plot? 回答1: I'm not sure if I am interpreting your second question properly, but assuming

HCL color to RGB and backward

白昼怎懂夜的黑 提交于 2019-12-18 12:26:09
问题 I need an algorithm to convert the HCL color to RGB and backward RGB to HCL keeping in mind that these color spaces have different gamuts (I need to constrain the HCL colors to those that can be reproduced in RGB color space). What is the algorithm for this (the algorithm is intended to be implemented in Wolfram Mathematica that supports natively only RGB color)? I have no experience in working with color spaces. P.S. Some articles about HCL color: M. Sarifuddin (2005). A new perceptually

Multigraphs in Mathematica 8

不羁的心 提交于 2019-12-18 12:17:01
问题 I just spent a couple of hours trying to convert some old code that uses Mathematica 7's GraphPlot to use the new Mathematica 8 Graph functions. It seemed sensible since the new graph drawing is much nicer and it has things like AdjacencyMatrix and KirchhoffMatrix built in. The problem is that I can not figure out how to get graphs with multiple edges to work in Mma 8. The Feynman graph that I use as my canonical example is the two-loop vacuum graph GraphPlot[{1 -> 2, 1 -> 2, 1 -> 2},

pair lists to create tuples in order

帅比萌擦擦* 提交于 2019-12-18 11:44:17
问题 I'd like to combine two lists. If I have the following two lists: {a,b,c,d} and {1,2,3,4} what do I need to do so that I get {{a,1}, {b,2}, {c,3}, {d,4}} ? 回答1: Here is one way: Transpose[{{a, b, c, d}, {1, 2, 3, 4}}] 回答2: An esoteric method is Flatten , which (from the Help Section on Flatten) also allows Transpose of a 'ragged' array. Flatten[ {{a, b, c, d}, {1, 2, 3, 4, 5}}, {{2}, {1}}] Out[6]= {{a, 1}, {b, 2}, {c, 3}, {d, 4}, {5}} 回答3: One possible solution is MapThread[List,{{a,b,c,d},{1

Get mathematica to simplify expression with another equation

社会主义新天地 提交于 2019-12-18 10:27:14
问题 I have a very complicated mathematica expression that I'd like to simplify by using a new, possibly dimensionless parameter. An example of my expression is: K=a*b*t/((t+f)c*d); (the actual expression is monstrously large, thousands of characters). I'd like to replace all occurrences of the expression t/(t+f) with p p=t/(t+f); The goal here is to find a replacement so that all t's and f's are replaced by p. In this case, the replacement p is a nondimensionalized parameter, so it seems like a

Efficient way to pick/delete a list of rows/columns in a matrix in Mathematica

你离开我真会死。 提交于 2019-12-18 04:21:31
问题 This question is in a way a continuation of the question I asked here:Simple way to delete a matrix column in Mathematica to which @belisarius and @Daniel provided very helpful answers. What I am generally trying to do is to extract from a matrix A specific lines and columns OR what remains after what those specified are removed. So this can be formally writtewn as, find TakeOperator and Drop Operator such that: TakeOperator[A,{i1,..,ip},{j1,...,jq}]=(A[[ik]][[jl]]) (1<=k<=p, 1<=l<=q) = Table