5
votes
1answer
45 views

How do I perform exact unit conversions with irrational conversion factors?

Suppose I want to express $3h$ in units of $\hbar$ (where $h$ and $\hbar$ are the Planck constant and reduced Planck constant, respectively). By definition, $h = 2\pi\hbar$, but when I attempt this ...
8
votes
1answer
120 views

Faster trimming of leading/trailing zeroes in rectangular array

Given a (large) rectangular array, e.g. (small for example case): ...
0
votes
0answers
51 views

How to make work Plus function? [duplicate]

I have a little problem. I have k = 1.56343*10^9; r = 9.10492*10^18. And I should receive a (2*r*r-k*k)/2*r*r, it equals to ...
0
votes
2answers
60 views

Use a Module to return multiple plots

A program I'm running requires me to generate multiple plots over the same domain, so I thought it would be fairly simple to use a module and bury all of the plot commands within that that way I only ...
5
votes
2answers
160 views

Nearest neighbor distribution

I need to construct nearest neighbor distribution for a given finite set of real numbers. I have no clue how this can be realized. Any suggestion would be very much appreciated.
0
votes
2answers
41 views

MousePosition and While loop Control, maybe Dynamic in While statement?

I would like to write a simple code that samples mouse position as frequently as the system can handle (with minimum dt) starting when the mouse position leaves a region and ending when the mouse ...
1
vote
1answer
31 views

Add Numbers to Notebook Cells

Let's save I have a notebook full of text cells. How might I add numbering to the text cells?
1
vote
1answer
46 views

Collecting specific Lists of data in coordinate form

Note: This might be trivial for many of the users but i am new to mathematica so i don't know!!! Question: Suppose i have three list of data as follows: ...
1
vote
1answer
54 views

Error with using NDSolve [duplicate]

I am currently trying to numerically solve a system of differential equations. Here is my code: ...
1
vote
1answer
59 views

How can I calculate the maximum number of grid layout possibilities?

I am doing some modelling where I am trying to randomly layout some points on a grid. What I know: How big the grid is The number of objects that have to be laid out on the grid, at a point The ...
1
vote
1answer
48 views

What is the correct idiom for mapping a 0 value in a modulo n expression back to n?

What is the correct idiom for mapping the $0$ value in a modulo $n$ expression back to $n$. For example if I want to be sure that any integer value maps back to the index for a character in the ...
0
votes
0answers
43 views

Can I redefine the ++ increment operator to make it behave like Haskell

In Haskell, joining two lists l1 and l2 is simply done with l1 ++ l2 In Mathematica ...
7
votes
3answers
231 views

Calculating average distance between maxima

I'm having trouble figuring out a way to analyze some simple data. When graphed, the data I have make a somewhat sinusoidal curve. What I want to do is to find the x-values of the maximum peaks of the ...
6
votes
1answer
69 views

Using Wolfram Library Reference in Excel VBA

Long time ago I did this question to MathGroup, but without success. In Excel VBA, in Tool/References, there is a option called "Wolfram Mathematica Control 8.0 Type Library" I belive that ...
0
votes
1answer
51 views

How to combine 2d and 3d plots with this code [duplicate]

I found a picture for example in google and I want to do with my code like that: And here is my code: ...
0
votes
0answers
24 views

ListContourPlot for 3D data [closed]

I have an n x 3 list of some solar cell data that looks like this. ...
0
votes
1answer
36 views

Integrating the second derivative of a 3D curve

I have a 3D curve K2[s_] := c1[s] + 0.4*(j[s]*Sin[500*Pi*s/97.8] - v[s]*Cos [500*Pi*s/97.8]) where j and v are frame vectors. I want to find the integral of ...
10
votes
1answer
155 views

How to access an already opened Excel file in Mathematica?

This post 4594 shows how to open a existent Excel file with Mathematica. And this 6686886 shows how to do what I need, but in C#. This 12282310 is another related one. How can I connect to a ...
0
votes
1answer
33 views

Is there a way to change the indentation behavior of the postfix operator //?

For example, using newlines after // results in some really weird indentation: Ideally, I'd love to be able to do something like this: ...
-1
votes
1answer
111 views

Finding a formula for a 3D shape and colouring it

I created a wall with line command ...
0
votes
2answers
155 views

FindShortestTour to solve Traveling Salesman Problem

I'm trying to write my own code to find the shortest route but I'm lost on how or where to start. Does anyone have any idea how the FindShortestTour function works? What type of algorithm or structure ...
3
votes
2answers
55 views

Dataset Query using Composition fails but RightComposition works - why?

V10.1 on Win764 Enterprise. In this (CORRECTED) example the two Queries may be compounded into one using RightComposition sucessfully... ...
0
votes
0answers
48 views

Problem with greek!

I am using mathematica v10. I have two promblems. 1. I cannot open notebooks made from another version of mathematica(I open them and i cannot read the greek fonts in a cell which i have wrote) 2. ...
7
votes
2answers
136 views

why MeanFilter is nearly 100 times slower than MovingAverage for 1D array?

I used to average over my data with MeanFilter before I learn about MovingAverage and thought that these two functions are similar except that MeanFilter is more powerful for its ability to deal with ...
0
votes
1answer
54 views

Input text next to plot axes

Please see the following image showing my plot. I would like to indicate $\omega$ is maximized at $\bar{\omega}$. But as you can see, it is cut and does not appear correctly. Do you know how to fix ...
0
votes
1answer
51 views

NMaximize with constraints [closed]

I want to find a maximum of the following function: ...
0
votes
1answer
26 views

Boundary condition not correctly imposed for NDSolve

I notice that when plotting the below NDSolveValue ...
-1
votes
0answers
21 views

EllipticK error message [closed]

I need help correcting this error message in Mathematica. ...
-2
votes
0answers
20 views

How to use EllipticK in a plot and avoid getting the “not a machine-sized real number” error message? [closed]

k = Sin[π/2]; m = k^2 θ (τ) = 2 ArcSin[Sin (π/3).JacobiSN[x_, m] {τ - τ0, k}]; Plot[θ (τ_), {t, 0, 4 EllipticK[m]}] ...
13
votes
6answers
670 views

Finding the period of an array of integers

A simple array of integers is given. The problem is to detect if a pattern is repeatedly occurring in the array, and find the length of that pattern. For example, for ...
1
vote
0answers
48 views

Failing to solve a simple PDE with NDSolve

I'm trying to solve the following PDE. Actually this is a major simplification of the original with all x,z dependent coefficients being fixed. For some reason Mathematica (10.0) cannot solve even ...
3
votes
1answer
80 views

compute the gradient in high dimension

The following code is used to compute the gradient of a given 2D data. ...
1
vote
2answers
95 views

Collect distributed sums

I have another task that somehow should be trivial. Suppose I have the following expression $$ \sum_{i=1}^n \frac{2}{9} x_i + 2 \sum_{i=1}^n \frac{1}{9} x_i, $$ or in Mathematica-FullForm ...
1
vote
1answer
32 views

Speeding up EPS exporting ?

I'm using Mathematica 10 to render some figures, and I'm noticing some strange behaviour with EPS figures. I'm making figures like the one below in EPS format. And to do so, I use some code like ...
1
vote
2answers
95 views

Plot with tick labels but without ticks

In scientific literature, plots often have a design like what I've been trying to make (see below). These images have the following characteristics: 1) Frames on the left and on the right 2) An x-axis ...
0
votes
0answers
27 views

What is the meaning of the lists of numbers in the FullForm of a compiled function?

For example, f = Compile[{{x, _Real}}, x]; FullForm[f] has this output: ...
-1
votes
0answers
24 views

Deriving expression for the 'curve-in' condition in an equiangular (log/bernoulli spiral) [closed]

For any 2 pairs of points (xe,ye) & (xs,ys), I can fit various equiangular spiral through those 2 points based on the equation r = ke^(aθ). A typical one is illustrated below: Then, I can vary ...
0
votes
0answers
29 views

Roots of two Functions containing integrals, with two parameters [duplicate]

I want to find the values of l1 and l2 from the following two equations: ...
0
votes
0answers
14 views

How to show user-defined level set when using ListContourPlot3D [closed]

I want to display the level sets of a 3D point data.(e.g. data values equal 2 and 4 respectively) The provided examples of RegionFunction option for ...
0
votes
0answers
79 views

Solving coupled differential equations with an eigenvalue

I have 2 coupled differential equations with an eigenvalue Ei and want to solve them ...
1
vote
2answers
47 views

Perform operation on part of a table / create a reference

There is a function f that I would like to operate on a rectangular part of a table t. The part is specified by function ...
1
vote
0answers
36 views

Optional arguments with lists as function parameter

I'm developing a function to process 3D data volumes which is very similar to ImageTake and should support the same optional arguments. ...
0
votes
1answer
43 views

How to convert absolute time to local time?

I tried this code: ...
0
votes
1answer
53 views

How to export Time Series Data? [closed]

I can't simply convert it to a list Normal аnd to export. I tried many times. But not successfull.
0
votes
1answer
81 views

Can we say that “all functions in Mathematica are some kind of pattern-matching-and-replacement procedures”? [duplicate]

Currently I am studying Mathematica programming, and when I study pattern matching and replacement, I find it is quite similar to functions. So can we say "all functions in Mathematica are some kind ...
-2
votes
1answer
44 views

Solve on parametric equation produces inequal results

I have a parametric (parameter t) equation in two dimensions (vectors). s = Solve[pt[t] == qt[t], {a, b}] Both pt and qt are parametric lines using a and b as ...
1
vote
2answers
68 views

Problem in matrix multiplication

I created a random directed acyclic graph using Mathematica. I need to compute a specific function from its adjacency matrix. ...
0
votes
1answer
27 views

Error Exporting STL --insufficient elements to export

I am trying to export the following code as an STL file: ...
0
votes
1answer
67 views

Eigen energies of 2D time independent Schrödinger equation

Firstly, I am aware that a similar question of this type was asked, but it was not helpful as it was only one dimensional (so please don't mark my question as a duplicate) The trouble I am having is ...
9
votes
1answer
131 views

Geocentric, Earth-fixed, coordinates of Sun, Moon (and others objects eventually)

I know I can get "HelioCoordinates" of the Earth and the Moon with ...

15 30 50 per page