6
votes
1answer
445 views

Simplifying a trigonometric sum

I want to caculate Cos[θ] + Cos[2 θ]+ ... + Cos[n θ] Sum[Cos[k θ], {k, 1, n}] ...
1
vote
3answers
820 views

Adding a Sphere onto an existing 3D plot

I have a 3D plot. I need to add a small sphere marking the starting point, r[t] == 0. I'm pretty new at Mathematica and would greatly appreciate some help. ...
3
votes
1answer
220 views

How to correctly disconnect from the kernel?

I'm connecting to and disconnecting from the kernel but I'm doing something wrong. I crash the text formatting in the terminal and got some warnings. There are some instructions to connecting to the ...
2
votes
1answer
171 views

WebServices context problem

I'm using two web services from the same host: Earth Orientation Center I can get each one to work on a fresh kernel but I cannot get both of them to work during the same instance of the kernel. I ...
4
votes
2answers
174 views

Assumptions for RotationMatrix

I'm making C++ program, and in my program I need a rotation matrix around any vector. I wanted to extract RotationMatrix[fi,{x,y,z}] output and put it in my ...
1
vote
2answers
577 views

Faster way to test if an expression equals zero

I want to test if expressions (mix of variables, functions and numbers) are zero valued, as fast as possible, and PossibleZeroQ is sometimes very slow. One solution ...
8
votes
1answer
318 views

Find a word's linguistic pronunciation

Is there a way to get a word's linguistic pronunciation given the word as a string? I would like a function LingusticPronunciation such that, for example, ...
1
vote
1answer
225 views

Maximize over permutations

I have a set $S=\{s_1,\ldots,s_k\}$ and would like to maximize a fixed expression over permutations of $S$: $\max f(x_1,\ldots,x_k)$ with $x_i\in S$ and $x_i=x_j\Rightarrow i=j$. Is there a ...
3
votes
2answers
301 views

Can I ask Mathematica to replace the arguments of my functions with a replacement rule?

I have an equation that I evaluate at some point (let's say $x=1$) that have terms of the form f[1,y] D[g[1,y],{y,2}] Is there an easy way to replace [1,y] by ...
10
votes
4answers
291 views

Searching linked lists that contain lists?

Following the advice I've read here and other sites, I've been trying to use the Mathematica equivalent of a linked lists... ...
0
votes
1answer
1k views

Equation with complex numbers and 2 variables

I have an equation: eq = 1 + ( 9 / ( s*(s + 9) ) )*( k/(s + b) ) == 0; where s == -2 + 2I (...
4
votes
1answer
302 views

Page breaks within input cells

I am trying to print a notebook that begins with a lengthy piece of code that takes up almost an entire page. Because of my heading, it doesn't quite fit on Page 1, so Mathematica inserts a line break ...
7
votes
6answers
211 views

How to join held Lists?

Let's say I have a = Hold@{2+2} b = Hold@{4+4} How can I get Hold@{2+2,4+4} ie join the two held lists ? More ...
5
votes
0answers
819 views

computation of gradient vector field in 3D using GradientOrientationFilter

I want to compute a 3D gradient vector field of an Image3D object using the built-in GradientOrientationFilter function in Mathematica. From the documentation I ...
3
votes
2answers
1k views

How to enter an equation into FindFit?

I have the equation ...
11
votes
2answers
365 views

How could I use Mathematica to remove finger tips that appear in images?

I used my photo camera to "scan" a heavy dictionary. I tried to have flat images by pressing the margins of the pages with my fingers. The color of the background is (normally) black and my fingers ...
1
vote
1answer
137 views

Assumptions about list elements

I am trying to simplify some expressions using assumptions and got an inconsistent behavior of Mathematica 9 when working with indexed variables. Consider ...
3
votes
1answer
167 views

Use of StringExpression as argument

Is it possible to use a StringExpression as a pattern for an argument? I.E. something like foo[chars__~~ WordCharacter.. ~~ num:NumberString] := {chars, num}; At ...
2
votes
1answer
140 views

Strings and Formatting

There is something about strings which doesn't seem to be totally clear for me (for the moment): When entering "a string", the output, formatted as "Output" gives this string without the quotes. But ...
2
votes
1answer
58 views

Label cell goes away with SelectionEvaluate

When a given cell has a label (given with the CellLabel->"label" option of the cell), then this label disappears after calling SelectionEvaluate[ nb ] when the ...
6
votes
1answer
144 views

Why LinearModelFit is slower than NonlinearModelFit?

Why LinearModelFit is slower than NonlinearModelFit? ...
0
votes
0answers
277 views

Solving stochastic master equation

Can someone help please me in solving the following stochastic master equation for the density matrix $\rho$? where $\rho$ is the density matrix, $\sigma_i$ are the pauli matrices, $dt$ is the ...
5
votes
2answers
383 views

How to find monotonically increasing intervals of a function

I tried this code, but not working Clear[f]; f[x_] := x^3 - 3 x + 2; ForAll[{x1, x2}, x1 < x2, f[x1] < f[x2]] Reduce[%, {x1, x2}, Reals] I expected the ...
8
votes
2answers
218 views

How to reduce the number of operations needed to evaluate an expression? [duplicate]

For some numerical calculations in C++ I have, for example, this complicated expression to evaluate. Given as Mathematica input, in its original form it is ...
0
votes
1answer
422 views

ListPlot with PlotRange -> Automatic giving unexpected results in V.9

There seem to be a problem with ListPlot auto ranging in Mathematica 9. Here's my code: ...
5
votes
2answers
399 views

Add blank line before end of file with export

I have a list of points (e.g. {1.2,0.4}) which I export to a file using ...
1
vote
1answer
136 views

ParallelTable of ParametricNDSolve objects fail

There seems to be a problem with ParametricNDSolveValue togeteher with ParallelTable First we create a ParametricNDSolveValue object ...
1
vote
1answer
172 views

ParametricNDSolve: Fails to differentiate an matrix differential equation

It seems like there is a problem with differentiating a ParametricNDSolve object when the underlying system contains an matrix differential equation. Create a simple ParametricNDSolveValue object ...
1
vote
1answer
487 views

Sum[expr,{i,0,Infinity}] for power series of cumulative normal distribution gives exponential function?

The Taylor series (about 0) for the cumulative normal distribution has coefficients: ...
8
votes
2answers
3k views

Labeling points of intersection between plots

There are several answers where Mathematica used mesh points to show graphically where curve intersections exist. For example: Marking points of intersection between two curves or Is there a better ...
4
votes
1answer
124 views

How to copy groups of cells with NotebookWrite?

I'm trying to use: NotebookWrite[nb, NotebookRead[EvaluationNotebook[]]; to copy cells from the EvaluationNotebook[] to a new ...
4
votes
1answer
153 views

Import audio in uLaw format?

How do I import a uLaw-format audio file into Mathematica? Here's an example: hello-world.ulaw For reference, here's the same file in wav format: hello-world.wav As I understand it, the uLaw ...
1
vote
2answers
144 views

Show Simplified Directives [closed]

Is there a way to force Mathematica to convert an already rendered Graphic to the simplified Directive form of that Graphic. Background: I am currently editing Graphics using Drawing Tools and then ...
8
votes
3answers
187 views

Protecting function definitions only for particular inputs

I would like to be able to define the values of a particular function for new inputs. f[x1]=f1; f[x2]=f2; I would also like to be able redefine the values for ...
6
votes
1answer
113 views

How to suppress automatically generated header in packages?

At the top of the .m file which is automatically generated from initialization cells in a notebook there appears a header: ...
3
votes
1answer
1k views

Convolution of two distribution functions

I have two functions; f[x_] = (1/k) Exp[-x/k] ; g[x_] = (1/p) Exp[-x/p] ; How I can convolve them? In Mathematica for convolving two functions we have this ...
8
votes
1answer
195 views

OpenSQLConnection problem - password visible

Prerequisites some database (here, it's called sakila (mysql standard test db I think)) a user (with password) that has access to that db (I'll use u:testuser/p:testpass) Setup - minimal (?) ...
1
vote
1answer
298 views

Why doesn't my code compile?

...
5
votes
3answers
358 views

How can I find English words among the names of the characters in the Mathematica character set?

I want to find some single meaningful words in the "ASCII/Unicode" form characters. For example, I want to get alpha from ...
4
votes
0answers
81 views

Error with String patterns producing Removed[“$$Failure”]

While working on How to capitalize the first letter of each word in a string and trying to understand why certain characters were not considered letters I tried this: ...
12
votes
3answers
766 views

How to capitalize the first letter of each word in a string

The following examples only work for the first character of the whole string, but not of words. ...
4
votes
1answer
205 views

Can't simplify Abs[a*Cos[x]]^2

Why doesn't FullSimplify[ Abs[a*Cos[x]]^2, Assumptions -> {{a, x} ∈ Reals}] simplify to (a*Cos[x])^2 but this query ...
3
votes
1answer
222 views

NDSolve: Reinitialize fails with If condition

I have found a weird problem using If conditions containing an state inequality of the form state<=. First consider the simple ODE with an If condition ...
11
votes
1answer
284 views

Possible bug with second argument of Dynamic

Bug fixed in V 10. According to the documentation, Dynamic Details & Options section, especially: For interactive mouse operations ...
13
votes
3answers
905 views

How can I convert colors to grayscale?

I want to change the above colored plot into a grayscale plot. I have tried this: CCGray[pic_?ImageQ] := Module[{}, ColorConvert[pic, "GrayScale"]]; but it ...
0
votes
1answer
125 views

Parallelize matrix operations

I'm trying to reduce to a minimum the time of some matrix operations. When I don't parallelize and write the code in the most compact form I get the operation done in around 1sec (is this good? the ...
0
votes
2answers
102 views

How to add a condition to a formula so that it will not appear at the result? [duplicate]

Sometimes I have very long and complicated equations, when I evaulate the equations for example taking derivative or integral there will be several conditions with the answer. My question is that; is ...
9
votes
2answers
2k views

Measuring execution time of code

How one can measure the execution time (time that is spent for code to finish) of a program in Mathematica? I understand that there are general timing functions (Timing, AbsoluteTiming, TimeUsed, ...
2
votes
0answers
208 views

Controlling page breaks

I'm writing a bunch of cells to a new notebook nb and am trying to control the pagebreaks. That is, I want a pagebreak after each Length[listOef] number of cells. ...
1
vote
1answer
114 views

Locator with Integer value coordinates [duplicate]

I want to get the Pixel value of an image.and here is my code ...

15 30 50 per page