0
votes
0answers
23 views

Using Compile with functions of n dimensions

I am currently working on problems that need to use variables in n dimensions. So I designed the functions that fit my problems. In particular the following functions : ...
2
votes
2answers
84 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: ...
1
vote
3answers
105 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 ...
24
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
9 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 ...
4
votes
1answer
39 views

What is the most practical way to define a “default” value for 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: ...
1
vote
1answer
40 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 ...
1
vote
2answers
41 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
20 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
44 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
65 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 ...
0
votes
1answer
31 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 ...
6
votes
2answers
65 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
464 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
417 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 ...
1
vote
1answer
48 views

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

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

How I can count multiplications in an experssion?

Next task to complete: Count *-symbol in such expression as a + s^2*b - c/y + o^3 + n*m*u (in this case count of ...
1
vote
0answers
57 views

Solution to heat equation with Neumann boundary conditions and lateral heat loss

I am conducting an experiment on heat conduction in a copper rod. To do so I am using a thin copper rod with several temperature probes, then I am going to compare the data with a solution to the heat ...
2
votes
1answer
344 views

What algorithms does NSolve use?

I've been using NSolve to find roots and now I've been wondering what underlying algorithm Mathematica uses. It's probabaly similiar to ...
4
votes
3answers
233 views

What is the best way to write a polynomial in the Bernstein basis?

The Bernstein basis of polynomials of degree $n$ is the set of polynomials of the form $$\binom{n}{k} t^{n-k}(1-t)^k$$ where $0 \leq k \leq n$. What is the best way to transform a given polynomial ...
10
votes
1answer
97 views

Is there a way to get BSplineFunction beyond MachinePrecision?

I have been using BSplineFunction (Mathematica 8) to generate a smooth representation of some data, which I might then do some further processing on. As I ...
0
votes
1answer
41 views

How can I solve an integral equation with two unknowns?

How can I plot g versus y? I do not understand how to solve it. ...
3
votes
1answer
114 views

How to sample n frames from a movie file?

I'm looking to import 100 image frames from an mp4 video file at roughly evenly spaced intervals. As $ImportFormats shows, Mathematica can handle Movie files: .avi, .mov, .qt, .flv Multiframe ...
0
votes
1answer
64 views

Is it possible to find the size of a variable in a notebook?

I have a fairly large a list of matrices matsLst, which takes about 15 minutes to compute (but computes successfully each time). I can test in the notebook that ...
10
votes
3answers
5k views

Increasing the thickness of line in plot legend

I've been using the shiny new legends in V9 for my plots. However, I usually increase the Frame/Axis ...
4
votes
1answer
271 views

How to sort colors properly?

I can't seem to be able to sort colors by their hue and perceptual brightness correctly. Here's my current solution but it's not right, there are all these dark bands: ...
1
vote
0answers
25 views

CCompile Problems

Operating System: Windows 8.1 Mathematica: 8 In possession of: Visual Studio 2013 and 2015 Had to alter the visual studios driver file within CCompilerDriver application, add-on so that it found the ...
-3
votes
0answers
50 views

Multidimensional Interpolation with 3 independent Variables with modfied data set

I have four column data with first 3 column denoting x,y,z and fourth column energy. x variable is actually angle. Now I want to interpolate over all three indepdent variable (x,y.z) with ...
3
votes
3answers
245 views

Hypergeometric function with a matrix argument

I am looking for the evaluation of a Hypergeometric function with a matrix argument as for example in Koev and Edelman or as showcased in this Wikipedia article. From what I understand from ...
0
votes
0answers
23 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 it's a psudo-code; ...
1
vote
0answers
48 views

Better way to binarize an image [on hold]

I have an image that I want to binarize. When I try to do it in Mathematica, the results is My code is ...
1
vote
2answers
106 views

How can I import a table from a Wikipedia page?

I'm trying to import this table from a wikipedia page containing the list of lunar missions into a Mathematica as an Association. Here, I'm trying to use the new ...
10
votes
0answers
103 views

Enigmatic message about MaxBend

Referring to the method I proposed for Problem with ParametricPlot Mathematica 10.0.2 throws an enigmatic error message: ...
0
votes
0answers
27 views

Is it possible to change default $HistoryLength [duplicate]

By default $HistoryLength is set to \[Infinity]. This is often unnecessary and can cause unecessary memory usage. I can of ...
3
votes
1answer
543 views

Specific Mathematica algorithms, for example LU Decomposition

Where I can find detailed information on algorithms used by Mathematica, especially for numerical methods. The Manual doesn't seem to iclude specifics in most cases. For example I get a different LU ...
0
votes
0answers
62 views

Why is PolyLog[] giving weird answers for ordinary values? [duplicate]

Possibly related to this question, but it seems slightly different: Strange behaviour of PolyLog Function Wikipedia says that for real s, z<1 should be real. So I was confused when MMa returned: ...
2
votes
1answer
45 views

Stopping NDSolver at time of error

I am using NDSolver and WhenEvent to solve a system of differential equations. I get this message: ...
0
votes
0answers
36 views

Please explain this unexpected code snippet behavior [duplicate]

Consider a function that maps a complex function z->f(z) to it's multivariable counterpart (x,y)->f(x,y) ...
5
votes
1answer
67 views

How to calculate residues using different branches of the logarithm

My goal is to be able to compute the residues of something like $z^{\alpha} R(z)$ where $0 < \alpha < 1$, $R(z)$ is rational, and the exponential can be chosen with any branch. I found a way to ...
2
votes
1answer
533 views

Creating hexahedral finite elements in Mathematica

Is it possible to do FEM using hexahedral elements in Mathematica? If it possible, is there any help to do that?
1
vote
2answers
82 views

Demonstration Confusion

What is the proper way to open a Demonstration in Mathematica so that the code is visible and can be evaluated from the Evaluation menu, as though I had created it myself? Explanation: When I ...
5
votes
3answers
119 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. ...
2
votes
0answers
48 views

Minimax for conditioned UnitStep functions

I made a simplified version of my problem, and I have now: ...
2
votes
1answer
61 views

gaussian integration

I'm new on Mathematica and I am an engeneer with only a little base of numerical computation. I have to integrate a trigonometrical function numerically with a Gauss integration. The function is: ...
1
vote
1answer
77 views

Matrix multiplication for higher dimensional matrices [duplicate]

I have a matrix like this (myb1): I would like to get the matrix multiplication of each of the submatrix to itself. For example the first 2x2 matrix $\begin{bmatrix}1 & 2\\1 & ...
7
votes
0answers
149 views

Is there a PrimeQ whose accuracy guarantee you can adjust?

Say I have a list of a million integers each with a million digits, and I want a crude sieve to see which have a chance at being prime. Mathematica has a PrimeQ function, which appears to be slow ...
0
votes
0answers
34 views

KroneckerProduct of the lowest eigenvector [on hold]

tmatrix, is a random matrix constructed with this command: tmatrix = RandomReal[{-1, 1}, {4, 4}] Its lowest eigenvalues can created by ...

15 30 50 per page