3
votes
1answer
163 views

Efficiently keeping elements in a list (an input list) that exist in another list (a keep list)

I have some code that generates lists of integers (one such list is called, for example, inputList). I also have a "master list" of integers that should be kept, ...
7
votes
1answer
231 views

How to wrap this dynamic code inside a Manipulate?

My goal is to set up a Ising-type simulation, where many fast simulation steps are done in the background, and a visualization of the current state is displayed as the simulation evolves, being ...
11
votes
3answers
2k views

How to use FindFit to fit an implicit function?

Now I am trying to fit some data with a implicit model function. Firstly, I tried a toy example. Toy example with input and output ...
17
votes
3answers
309 views

Nested definition: How can I define a function with a passed-in expression?

Here's a simplified version of what I'm trying to do: ...
13
votes
1answer
386 views

What strategies can I use to evaluate a limit when Limit[] returns unevaluated

I'm trying to find the following limit using Mathematica: $$\lim_{N\to\infty}\sum_{k=1}^N\left(\frac{k-1}{N}\right)^N$$ The problem is taken from here and is known to converge to ...
10
votes
3answers
853 views

Correcting a correlation matrix to be positive semidefinite

Does Mathematica have a way to "fix" a correlation matrix that is not positive semi-definite? I looked through the documentation and search the internet but could not find anything.
22
votes
6answers
1k views

Convert an expression to a Function

I need a function which can take an expression and return a pure function based on the symbols in the expression. The symbols might have values so must be protected from evaluation. It is probably ...
6
votes
1answer
449 views

How to turn a random graph into a matrix

I have constructed a random graph with Mathematica using the RandomGraph command. Now I would like to convert this graph to a matrix, but I don't know how. The ...
4
votes
1answer
203 views

How to Rasterize in “Printout” style

I am trying to ascertain how large a justified text block will be when printed by rasterizing it in the "Printout" style environment. However, ...
1
vote
1answer
148 views

How can I make CDF which uses user defined function

I have a user defined function which is called many times in the code. I want to ask that when I am deploying the code toCDF, I need to define that user defined ...
4
votes
3answers
356 views

Table in a Legend

Calculated data: ...
2
votes
2answers
371 views

How to avoid this kind of numerical error caused by extreme parameters when using NDSolve?

Here I use a one-dimensional heat conduction equation as the example. I found that when the thermal diffusion coefficient is small enough, Mathematica will give a result against the second law of ...
8
votes
2answers
326 views

Series expansion with irrational power

I need the series expansion of a fairly nasty function and its derivative: ...
7
votes
1answer
669 views

Probability and distribution from actual data

Let's say I have some data from a real world system: ...
12
votes
1answer
550 views

How to find out available fonts from within Mathematica?

How to find out available fonts on the system from within Mathematica? When I do Style["foobar", FontFamily -> "Foobar"] how do I know which font the ...
0
votes
1answer
604 views

How to add a grid on Plot, ListLinePlot and ListPlot? [duplicate]

Possible Duplicate: How to insert guide-lines in graphics without specifying range? When we're using ArrayPlot, it's possible to draw a grid by doing: ...
10
votes
1answer
415 views

Automating FTP upload within Mathematica?

I have MMA-generated html and would like to automate uploading to a named directory to a web host via SFTP or HTTP POST, ideally without creating local temp files. The closest question I could find on ...
4
votes
1answer
170 views

Help with Permutations

I am currently trying to generate a list of permutations of length 2 of elements of a list of strings. For example: ...
2
votes
1answer
231 views

Can I create a dynamic number of rows in TabView through an iteration?

I have written code, with the help of stackoverflow of course, and I want to make it user friendly so that other people in my lab can use it. I'm playing with DialogCreate and similar functions. I ...
5
votes
2answers
939 views

Windows IME Chinese blocking shortcut for ctrl + space

I currently use the Windows IME on Windows Vista to allow myself to type Chinese characters (not in Mathematica), and by default typing CtrlSpace switches between the English keyboard and the Chinese ...
3
votes
1answer
220 views

Extraneous Keyboard Shortcut for ctrl + '^' in Mathematica 8

I would like to use the keyboard shortcut Ctrl^ to enter a superscript. I have tried to type this two different ways, and each time i have gotten an undesirable result. According to the file ...
1
vote
1answer
165 views

Particular solutions of a Differential Equation not evaluated in a given case

Below first case which gives particular solutions of an OED correctly: ...
2
votes
2answers
389 views

Calculate with units

If I want to calculate with units, for example using Pythagoras theorem, I would do this: c = Sqrt[(3m)^2 + (5m)^2] The result will be ...
4
votes
1answer
534 views

Draw tangent to point in ListLinePLot

I am using ListLinePlot to draw a number of points to a graph: ...
2
votes
3answers
210 views

Plotting function lists [duplicate]

Possible Duplicate: Difference in Plot when using Evaluate vs when not using Evaluate Why do I have to put Evaluate[] here Why is ContourPlot not displaying this curve? Why is nothing ...
7
votes
2answers
277 views

How to see the 'source code' of DockedCells? ALT: How to 'show expression' of DockedCell?

Here is a CDF file with the dockedcells toolbar (at the top). I'm trying to see how he created and positioned the logo, the formatting buttons, table of contents, etc, through a source code of it, but ...
1
vote
2answers
163 views

How to compare the InputField values in For loop dynamically

I am using a For loop for printing five InputFields. The loop gets its values from the variable tx. I want to compare the values ...
19
votes
6answers
1k views

How to improve the performance of solutions to Project Euler (#39)?

This is the problem 39 of Project Euler, which I asked in the chat room two days ago. My original code runs as slowly as snails, and finally I got two answers from JM and Rojo. Unfortunately, both of ...
1
vote
1answer
148 views

How to collect q[t] from the following integration

As shown in the following program, the q[t] in a can be collected from the integration by defining the integration of ...
4
votes
1answer
309 views

help with dynamic input

I'm trying to build a pop up window with i lines. Each line would read: Number of neurons in layer 1: Number of neurons in layer 2: etc until layer i The user would enter a numeric value on each ...
6
votes
2answers
990 views

How to mark visible points on a Plot3D?

I'd like to illustrate a two-variable function discontinuous at zero. The function is $f(x,y)=xy/(x^2+y^2)$ unless $x=y=0$, in which case $f(0,0)=0$. I thought that I could draw a plot and then mark ...
4
votes
2answers
2k views

How to handle NDSolve::ndsz problem (singularity problem)

I have 2 second order differential equations (non-linear). The physics behind them is correct. I verified the equations many times. It is a solid pendulum with a mass-spring at the end of it. Now, ...
3
votes
1answer
140 views

Manipulate not showing anything

This works: Manipulate[Plot[2*x + 3*y, {x, 3, 4}], {y, 3, 4}] But this doesn't ...
4
votes
1answer
245 views

How to output from a .NET console app to an existing Notebook in Mathematica?

I'm wondering if its possible push output from a .NET console application to an existing Notebook that is open in Mathematica. The reason I'd like this is that I want to use Mathematica as a ...
14
votes
2answers
395 views

How can I generate a legend for a BubbleChart?

Is there a way to make a nice disk radius legend (with linear or log scale) for a BubbleChart[]? Something like the following example should be built in!
4
votes
4answers
210 views
5
votes
1answer
94 views

What is the simplest way to determine which call to a superfunction has generated a Message?

I have a complicated function which contains many calls to NIntegrate, NSolve, FindRoot and ...
2
votes
1answer
969 views

Constructing variable names from a string

I have groups of descriptive variable names and dont want to write explicit code for each group, e.g. (and this is a contrived simplification) ...
3
votes
1answer
195 views

How to align grid dividers of inner grids in a grid?

How to have the vertical dividers of inner grids aligned to each other in the following? ...
6
votes
1answer
328 views

The difference between “SymbolicProcessing” -> 0 and restricting the function definition to numeric values only

The Documentation tells us that there are two ways to disable symbolic processing of the integrand by the NIntegrate function when it is known that it just slows ...
3
votes
3answers
367 views

Limiting form of a polynomial expression

When simplifying an expression by hand, a trick that is often used is to remove terms that are lower powers of the independent variable, for instance, as $x \rightarrow \infty$, $x^2 + x$ becomes ...
5
votes
1answer
222 views

Resolving reduced resolution issues in WSMLink

I have been attempting to evaluate Wolfram System Modeler (WSM) and it has not been going smoothly. It looks like some of the Modelica Models (combiTable1D for instance) supplied are not complete or ...
15
votes
6answers
1k views

Visualize Pascal's triangle and other triangle shaped lists

How can Pascal's triangle be visualised like this in Mathematica? Or more generally, how can a 'triangular' list like {{1},{1, 1}, {1, 2, 1}} be visualized in ...
8
votes
1answer
368 views

Generating dynamic Inputfields

I want to create a bunch of input fields, four in this case, one for each element of the list "x", but since Dynamic has ...
7
votes
3answers
485 views

Shading regions in ParametricPlot

I am using ParametricPlot to get an X vs Y plot. I want to shade the area enclosed by the curve falling in the region where Y<0. For example, how to shade the area enclosed by the Sin curve where ...
10
votes
2answers
1k views

How to change the style definitions for Default.nb?

I have looked over other questions related to style definitions, and looked through the Mathematica 8 documentation, but I do not know why I am having so much difficulty setting the default font in my ...
0
votes
1answer
283 views

StringJoin/FileNameJoin doesn't quite work in script

My mathematica script is as follows: ...
2
votes
3answers
171 views

How do I interpret the following syntax?

I have been given some code with the following line PeriodicExtension[g_, x_] := If[Abs[x] < Pi, g[x], PeriodicExtension[g, x - 2 Sign[x] Pi]] I do not ...
3
votes
2answers
400 views

Precision of number not maintained when saved via Export

Assume that the output of my calculation is a and is a number such as: a = 100.1252135246354847; ...
26
votes
5answers
1k views

Identifying critical points of 2/3D image/cubes

Upshot I am interested in identifying critical points of a 3D field/cubes (maxima, minima, tube-like and wall-like saddle points) and 2D field/image (maxima, minima, saddle points). I.e. the ...

15 30 50 per page