8
votes
0answers
120 views

Can code optimize code?

Are there functions, programs or packages that deal with optimizing mathematica code i.e. re-writing ineffecive or convoluted code. -This question has haunted me since I joined SE. The background for ...
0
votes
1answer
39 views

Ivar error with Fit inside Plot

I'm trying to plot this Plot[Fit[med,{1,x},x],{x,0,10}] Why this doesn't work? I find out that if I do ...
0
votes
0answers
53 views

What methods does Solve use?

Could you tell me which method that Solve applies to solve linear and polynomials equations?
5
votes
1answer
94 views
7
votes
1answer
164 views

How can I only draw outer common tangent to two circles?

I have code worked for drawing common tangent lines to two circles(http://en.wikipedia.org/wiki/Tangent_lines_to_circles), now I want to delete the inner common tangent lines, how? ...
7
votes
1answer
129 views

How to find the positive region of this function?

I'm new-ish to Mathematica and I'm using it to learn the basics of derivative trading (for fun not for trading!). I've defined a simple function to calculate the pay off of a trading on a call. I have ...
0
votes
0answers
23 views

What is the common term of this series? [closed]

Consider the following series of numbers . 3,5,17,257,65537 What is the common term of this series? (n is a positive integer)
4
votes
3answers
129 views

Plot failing over set domain with any functions

I'm here with a rather interesting problem which I have no clue how to fix. I am trying to plot a function: Plot[x && 0 <= x <= (1/8), {x,-9,9}] ...
2
votes
2answers
61 views

ToExpression from commandline [duplicate]

I like to use Mathematica 8.0 from the commandline, then I just have to SSH in, no matter where I am, and go. I also like to do this without forwarding X, because that is slow and lags on my ...
4
votes
2answers
100 views

Is there a built-in function to map a list of heads to a list of data?

Assume that this built-in function is called func. What I want is func[{f,g},{a,b,c}] will return the following result: ...
0
votes
0answers
24 views

Sinchronicity and probability [closed]

"Synchronicity is the experience of two or more events as meaningfully related, where they are unlikely to be causally related. The subject sees it as a meaningful coincidence." Wikipedia First, I am ...
1
vote
0answers
133 views

What are the best tips in Michael Trott's beer/whiskey Wolfram Blog post? [closed]

Michael Trott posted this incredible tour-de-force on the wolfram blog: http://blog.wolfram.com/2014/08/19/which-is-closer-local-beer-or-local-whiskey/ The length of the post is overwhelming, so I'm ...
5
votes
1answer
99 views

How to graph the revolution of solid limited by 2 points in x axis [duplicate]

I'm learning how use this program. And I have problem with how graph the solid of revolution.Here i write one exercise. y=2-1/2x, y=0,x=1,x=2; about the x-axis. This is the graph also the volume ...
3
votes
2answers
76 views

Problem with machine number precision in compiled functions

When I compile a very big function and give it input the function returns error. I realized that this is because the value of the function becomes smaller than the smallest machine number. Is it ...
3
votes
1answer
48 views

Part specification error only in LogPlot

I've a problem. I defined a simple list and a function like below: lst := {5, 10, 20} f[m_] := lst[[Floor[m/10]]]; and drew a plot ...
0
votes
0answers
75 views

Formula for a 15 - Puzzle game (Backwards and forward solution) [closed]

So I currently code a 15-Puzzle Game. Every tile has position starting between 1 and 16. For example has a tile which is at the position where number 3 should be the position 3. Now I need to find ...
2
votes
3answers
88 views

Dependency injection - use a specific implementation of one function within another

Consider... f[x_]:=Body containing h[some args]... g[x_]:=Body containing h[some args]... However I want to define something like... ...
4
votes
2answers
105 views

Find file names in directory

I am trying to find the list of any file in any directory of a given name (by in the directory, I mean directly in the directory, so in a directory which is in the directory would not count). For the ...
8
votes
5answers
318 views

How to generate random points in a region?

The Mathematica 10 documentation was updated for FindInstance adding support for regions. In my use case I'm trying to sample points in a set of disks: ...
1
vote
1answer
90 views

Bad fonts in Mathematica 10

In Mathematica V10, the glyphs for mathematical and/or other special symbols are wrong. I see this in input cells and also in the Basic Math Assistant palette. How do I solve this problem?
3
votes
3answers
111 views

Help with coding triangular nodes/elements

I'm trying to write a program where it will shoot out the triangle node numbers. For example, in the picture, if we choose to divide this triangle by 5 points, then the program will return out the ...
1
vote
1answer
53 views

Importing multiple images for machine learning classification

I want to create a ML classifier using images just like this example. I have two classes of images in two different folders. Is there an easier way to import all images from both folders rather than ...
2
votes
0answers
52 views

How to solve for exponents in an infinite product?

Say I have a power series, $f(x,y) \in 1 + x\mathbb{Z}[[x,y]]$ Then it admits a unique expansion $$f(x,y) = \prod_{i=1}^\infty \prod_{j=0}^\infty (1 - x^i y^j)^{n_{i,j}}$$ for some integers, $i, ...
5
votes
2answers
91 views

Return value of Reap when using tags

I've noticed a behaviour of Reap that I don't quite understand yet. Suppose I want to Sow several values during a computation. ...
1
vote
1answer
87 views

Horizontally compress a picture with varying compression ratio [closed]

I have a function c[x] whose domain and range are both [0,1]. And I have a picture with width W, height ...
7
votes
0answers
105 views
+50

How to export .mtl files for 3D textured objects

I would really like to deploy my textured 3D graphics in the web with sketchfab in my blog. Unfortunately, Mathematica only exports the shape of the 3d graphics, i.e. the .obj file, but omits the ...
2
votes
0answers
39 views

Two problems with NDSolve when using Method -> Projection

I tried to solve a system first order differential equations together with a constraint equation. I use the Method -> Projection to check if the constraint holds ...
1
vote
0answers
74 views

Window ▶ Show Handwriting Input

How might I force Mathematica to display the Handwriting Input menu? Currently I'm on W7 using a Wacom Tablet and unable to find the Handwriting Input option. It doesn't display under Windows>.
6
votes
3answers
219 views

How to count the integer grid numbers defined by inequalities?

I have the following code to show a red area defined by inequalities: ...
4
votes
3answers
267 views

DSolve not finding solution I expected

Try to solve the following ODE via DSolve $$ \left\{\begin{aligned} y'(x)+2 y(x) e^x-y(x)^2 &= e^{2 x}+e^x \\ y'(0) &=1 \end{aligned}\right. $$ The ...
0
votes
0answers
41 views

Lightweight Grid preferences screen stopped working after v10 install

I am getting the following error when I try to open the Lightweight Grid "Preferences" tab... ...
3
votes
1answer
96 views

May I restrict caching to disk when memory runs low? [duplicate]

An hour ago, I had to hard reset my laptop again because Mathematica froze the system again. When import a large file or make a mistake that produces huge arrays with complicated entries etc., I often ...
15
votes
4answers
298 views

Make MapIndexed listable

My goal is to apply MapIndexed to every element of a nested list without destroying the arithmetic operations within the elements. For example, let's start with ...
1
vote
2answers
54 views

How to use the output we see of expression when this expression is inside Dynamic

Consider this example: Manipulate[status = Dynamic[If[a < b, Yes, No]], {a, 2}, {b, 5}] The output of this calculation is ...
1
vote
2answers
620 views

Computing 10-dimensional volume of a 9-sphere [closed]

I'm trying to compute 10-dimensional volume of a 9-sphere with radius r using Monte Carlo. ...
7
votes
1answer
75 views

On using DiracDelta[t] in OutputResposne in version 10. Different result from version 9

I am baffled by this. I was trying to run same example I had working in version 9.01 and found now I get empty plots. The example is here . Here is a simplified version of the above. The same exact ...
1
vote
1answer
38 views

Connect to Windows kernel from Linux computer

I've seen many questions regarding the connection to a Linux machine from a Windows one, but I need to do the opposite. Situation: I have Mathematica on my Linux laptop (...
12
votes
1answer
140 views

Is it possible to insert new colour schemes into ColorData?

Because of the standards in my field, for many plots I need to use (or at least end up using) rather narrowly defined colour schemes, and in particular the Matlab "Jet" scheme, which is well described ...
7
votes
3answers
154 views

Different results with DateRange and LeapYearsQ in Mathematica 9 and 10

With Mathematica 9.0 for Mac OS X x86 (64-bit) (January 24, 2013) one could use DateRange[{2000}, {2010}, "Year"] to achive ...
0
votes
0answers
46 views

Disable Input Assistant Mathematica 10 [duplicate]

In the new Mathematica 10, every time I hover over a function for more than 0.001 second, this stupid box appears. In Mathematica 9, I had disabled it. However, no matter what I change in the ...
4
votes
1answer
108 views

How to vary line thickness to add a sense of perspective?

Is there a simple way to vary the line thickness relative to the viewpoint so as to add a sense of perspective? Take for example the following: ...
0
votes
0answers
52 views

Calculate the power spectral density of a Markov chain

I would like to calculate the symbolic power spectral density of a two state Markov process with a symbolic transition matrix characterised by two parameters. I have tried the below, but it doesn't ...
0
votes
0answers
38 views

NDSolve::derarg error: requiring pure function in solving differential equations

I'm trying to numerically solve 2 partial differential equations eq1 and eq2 given the boundary conditions in ...
10
votes
2answers
253 views

Map of United States as a 3D histogram

By combining the state data from here and the extrusion code from here I have managed to make prisms of the various US states such as However, the extrusion method looses information about the ...
1
vote
1answer
71 views

How to apply a trigonometric identity to a formula

The product of cosines is given by (Wikipedia): $ \prod_{k=1}^{n} \cos{\theta_k} = \frac{1}{2^n}\sum_{e\in S} \cos(e_1\theta_1+\ldots+e_n\theta_n) $ where $S={1,-1}^n$. How can I apply this to a ...
9
votes
2answers
87 views

Automatically add appropriate prefix to Quantity

Is there a function that automatically adds the appropriate prefix to a Quantity object? For example, I would like a function ...
7
votes
2answers
244 views

FullSimplify giving unexpected result

When I perform a FullSimplify on the list $$ \left\{-\sqrt{5-2 \sqrt{6}},\sqrt{5-2 \sqrt{6}},-\sqrt{5+2 \sqrt{6}},\sqrt{5+2 \sqrt{6}}\right\} $$ I get $$ ...
3
votes
2answers
84 views

Expectation of a composite Markov-Gamma distribution

In a model I have a discrete two-state first order Markov process, defined by a (2x2) transition matrix with two free parameters. If the first state occurs then the process outputs zero for that ...
2
votes
3answers
206 views

How can I get the function of a plotted trajectory? [closed]

I solved two ODEs, which are a function of t, numerically. The first ODE is the vertical equation of motion and the second one is the horizontal equation of that ...
1
vote
0answers
63 views

Is it possible to add page break in front-end? [closed]

Description: I have accomplished my undergraduate paper as a Mathematica notebook. In this condition, I find it convenient to typeset formula and words in a notebook environment. However, I feel ...

15 30 50 per page