1
vote
0answers
57 views

Alternative to use a function as an argument in Compile

I am currently working on problems that require the use of functions such as : ...
1
vote
1answer
19 views

Reduce Inequality

How can I reduce the inequality in terms of modulus of alpha. ...
1
vote
3answers
44 views

Efficiently test membership for a list of values

I have two lists: excluded and values. I would like to efficiently determine whether ...
2
votes
2answers
43 views

Fitting - Exponential

I'm trying to fit the following data using Mathematica, but unfortunately im not getting any decent results. ...
2
votes
2answers
89 views

How to declare a function as real in order to get rid of Conjugate in front of the expressions?

I have a complicated complex function containing some other ones that are real, f=f(A,B,C,...) ,where A=A(r) and it is real, for ...
2
votes
2answers
236 views

How I can integrate $\int_0^{a} x e^{-\frac{b^2 x^2}{2 c}} J_0(n x) dx$?

How can I get a solution to the integral given below ? $\quad \quad \int_0^{a} x e^{-\frac{b^2 x^2}{2 c}} J_0(n x) dx$ where $a,\,b,\,c$ and $n$ are constants and $J_0$ is a Bessel function of the ...
0
votes
1answer
76 views

How can I solve the sum with two unknowns?

I have the following code description ...
0
votes
1answer
36 views

If statement for evaluating small values

I have a simple calculation which I am trying to use if condition to evaluate summation of some values, here's a code; ...
1
vote
1answer
62 views

Implicit derivatives in one line. How do I do it?

I have this little script to derive implicitly $PrePrint = # /. {D[y_, x_, NonConstants -> {y_}] :> y'[x]} &; Example: ...
0
votes
1answer
31 views

Write a function pollard[n, B] that tries to factor an integer n, using Pollard's p − 1 method with at most B iterations

This is what I got but it seems it's not working. When I test it, it just goes through and nothing gets returned. Is there something I'm missing? ...
5
votes
1answer
74 views

Is there a practical way to define a default value for missing keys in an Association?

It can be very useful to define background or default value for an object that can be incremented or otherwise modified. A simple (and for me, common) use is a counter: ...
2
votes
4answers
96 views

ToExpression in Manipulate

lets take this small example code: Manipulate[Plot[Sin[x (1 + a* x)], {x, 0, 6}], {a, 0, 100}, Button["a=90", ToExpression["a=90"]]] By clicking the button I ...
0
votes
1answer
21 views

How to get DistributionChart to show normalised densities?

I am having some issue getting DistributionChart to show bin widths as expected, or perhaps it is in my interpretation of the plots. I have four data sets, all of the same length, and plot them in ...
11
votes
0answers
120 views
+50

How can I smooth a 3D surface generated by RegionBoundary?

I have a set of points that belong to the surface of an object. I would like to approximate a surface to which I can compute the distance. of other points. With the nice code of this post, I was able ...
3
votes
1answer
17 views

How to use locally scoped dynamic variables in Manipulate for expression and control parameters

I have a Manipulate that has dynamic variables that I want to use in the displayed expression and use in the parameters for the manipulate controls. I only ...
0
votes
1answer
110 views

Scatter Plot of Lists

This is very similar to Make a scatter plot from two lists I have executed a = Import["file.csv"] b = Import["file2.csv"] and now have a {{1,2,3}} and b ...
1
vote
1answer
70 views

Better way to binarize an image

I have an image: pic = Import[ "http://note.youdao.com/yws/public/resource/\ 2c5a562224240edcf1631fcd39810f56/55FA538207424C0A98AB548724994AE1"] that I ...
0
votes
0answers
60 views

PDE with Laplacian time derivative term

Using Mathematica 9 I am trying to solve the 2D PDE: c1*Laplacian[-u[x,y,t],{x,y}] + c2*D[Laplacian[-u[x,y,t],{x,y}],t] == 0 (Eq.1) with time-dependent Dirichlet ...
8
votes
3answers
221 views
4
votes
2answers
121 views

What is the idiomatic way to shift and extend a list by a number of elements?

I have a lists, list, and want shift it right by a given number of elements, m, extending the list by repeating the last ...
1
vote
2answers
30 views

How to delete blank valued keys from nested association?

Considering we have: acs = <|"A" -> <|"a" -> " ", "aa" -> "asd"|>, "B" -> <|"bb" -> " "|>|> How can we come to have a result ...
5
votes
3answers
130 views

Finding the conditions for degenerate solutions to a cubic equation

I have a cubic equation (corresponding to the band structure of a physical system) given by w in the code below. ...
0
votes
0answers
19 views

How to make 3D error bars in a plot? [duplicate]

if I have the following data in this format and the error bars are the same for each point: ...
78
votes
6answers
7k views

Generating visually pleasing circle packs

EDIT: (my conclusion and thank you note) I want to thank you all guys for this unexpected intellectual and artistic journey. Hope you had fun and enjoyed it the same as I did. I would like to ...
1
vote
2answers
101 views

Are variables always assumed to be real in Jordan Decomposition?

If you give the Input in Mathematica 9.0 (Student Edition) JordanDecomposition /@ ({{1, #}, {#, -1}} & /@ {i, I}) Mathematica gives you two completely ...
0
votes
0answers
11 views

Comparing association using MatchQ [duplicate]

For me below query results into False.I expect it to return True. ...
1
vote
1answer
35 views
+50

How to access timings of each individual test in a TestReport?

I want to know how long each VerificationTest took to complete in the test report, so see which one was the longest and do some statistics on them: ...
1
vote
0answers
29 views

How to solve a nonlinear overdetermined system of equations

i'm trying to solve a nonlinear overdetermined system of equations (124 equations, 123 variables) i tried this procedure (newton raphson) ...
3
votes
2answers
56 views

Retaining relative sizes of local maxima using MaxDetect[List]

I would like to be able to find the position of the two greatest local maxima in a list. For the example: list={1,2,3,4,2,1,2,6,5,4,3,2,} I would like to return ...
11
votes
3answers
473 views

How to speed up Colorize

I have a list of about 500 images similar to the following: A = Import["http://i.stack.imgur.com/1bV4O.png"] ...
6
votes
0answers
99 views
+50

NMinimize with NIntegrate (crash in symbolic evaluation, memory leak)

This is a "common" problem from what I've seen, but with a different spin. I have a function I use often that finds a fit of an expression to another expression with some free parameters (e.g. for ...
0
votes
1answer
48 views

Solving a linear differential equation [on hold]

I have been following examples in an introduction to mathematica. But the following example regarding a linear differential equation does not work: ...
3
votes
0answers
14 views

Declare new “Form” wrapper and avoid this wrapper being recorded in Out[…] [duplicate]

When I input {{1,0},{0,1}} // MatrixForm and then m = %;, the value that m takes is the ...
0
votes
0answers
25 views

what the meaning of subscript in matrix below? [on hold]

${-, 0, 0, 0, 0, 0, -((b 1 (1 (n-n 1)-a 2 (-1+2)))/(n ))}, {0, -, 0, 0, - Subscript(1,0)[(n 1 1+a 2 2)/(+),0], 0, -((b  2 (n 1 1+a 2 2))/(n  (+)))}, {0, 0, -g-, 0, 0, 0, (b ...
2
votes
2answers
88 views

How to restrict the motion of a Manipulate-generated Locator along a line?

If one uses a stand-alone locator and needs it to only be movable along a curve, say, defined by a function f[x], one can use a simple construct: ...
2
votes
3answers
117 views

Solving a differential equation with NDSolve and plotting it WITH the use of Manipulate

I want to solve, let's say, this differential equation: y'[x]=y[x]^n Given any initial condition (which I might want to manipulate too). I want to plot the ...
25
votes
7answers
2k 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 ...
0
votes
0answers
18 views

Nonlinear boundary value problems for fourth order ordinary differential equations

I am trying to solve a set of equations which are fourth order equations. I want to get the value of w ...
1
vote
2answers
59 views

TargetFunctions option in FindDistrobution yields error

I have some data set that I am trying to find the maximums . I figured I could do this by fitting the many peaks of the dataset to Gaussian distributions and then finding the peaks of this data from ...
1
vote
1answer
30 views

Non-autonomous Dynamical system Sliding mode controller Error

This code is a simulation of a sliding mode controller of a non-autonomous dynamic. When I use ArcTan in input, I receive an error. ...
2
votes
2answers
55 views

Aligning Density an Contour Graphics

In radiation therapy, we display radiation dose as an isodose contour plot overlain on density plot describing the patient geometry (CT data). Here is a simple example (the material grid is voxelated ...
3
votes
3answers
67 views

Orderless storage of tabulated function values

I would like to elaborate on my previous question Function of arguments given in non-fixed order and a relevant related one Best practice of passing a large number of parameters to functions I find ...
1
vote
1answer
44 views

Ndsolve problem with Sign

Using Sign(...)] in the formulation of my system of ODEs is causing an error that I don't know how to correct. If I use (...) in ...
7
votes
2answers
110 views

Getting a correct custom legend for contourplot?

I am having trouble making a custom range for a legend in ContourPlot since the legend doesn't "talk" to the PlotRange and ...
2
votes
1answer
470 views

Animated Wave propagation using split operator method

Here is the state of the art: By solving the time-dependent Schrödinger equation, one obtains that the propagated wave function after time step $\Delta t$ can be calculated by applying the ...
6
votes
3answers
421 views

Locators in Manipulate not moving properly

I thought a simple Mathematica kerning machine (for adjusting the space between characters) would be interesting, but I'm having trouble with the locators. (There are a number of other questions ...

15 30 50 per page