0
votes
0answers
69 views

Operatorial matrix

Suppose I have a matrix M=$\begin{pmatrix} A(p) & B(p) \\ C(p) & D(p)\end{pmatrix}$. I want to apply some operatorial matrix E such that EM=$\begin{pmatrix} 0 & \partial_p & \\ \...
4
votes
1answer
1k views

Convert mathematica math expression form to python math expression?

I obtain a raw input form of: ...
7
votes
3answers
175 views

BarLegend can't make spaced contours when contours number>11

According to Document of BarLegend,BarLegend will select equally spaced contours: BarLegend[cf,contours] generates a legend that identifies color ranges from the color function cf based on the ...
1
vote
1answer
86 views

Functions behaving weirdly

The following code f[k_, n_] := Sum[2*(1 + Sum[f[k - j, n - m - j], {j, 1, k - 1}]), {m, 1, n - k + 1}] f[4, 7] f[4, n] gives the output: ...
1
vote
1answer
107 views

Problem of Discrete Fourier?

I tried Fourier Transform for a range of figures. Firstly, I tried in this way. ...
4
votes
1answer
273 views

How to vary finite difference approximation order in `NDSolve` at boundaries

According to here, NDSolve, when using the method of lines, creates partial derivatives in the spacial coordinate (lets talk just about one spacial coordinate for ...
1
vote
2answers
70 views

Coefficients in multidimensional polynomials

I have a multidimensional polynomial depending on {x[1],x[2],x[3],x[4]}. If I want to selectively collect the coefficient corresponding to e.g. ...
2
votes
1answer
360 views

Putting N cubes on a circle

I'm trying to put $N$ cubes on a circle equidistantly. So in the case of 4 cubes, I'd for example like to put the lower left corner of the first cube at $\pi/4$, the lower right of the second cube at $...
2
votes
2answers
131 views

What is the meaning of Range[10] /. {x_ /; PrimeQ[x] -> x^2}? [closed]

I'm currently doing a unit at university that touched briefly on Mathematica, but the final exam will feature multiple choice questions from Mathematica (along with excel and matlab). This leads to ...
1
vote
0answers
64 views

Efficient way for solving a matrix equation

I am looking for a more effcient method to perform the following analysis. I did my best, but running the following code on my machine takes 9.766s. I need to perform this analysis several times. <...
0
votes
1answer
79 views

Problem in solving non linear set of equation?

I am trying to solve a set of non linear equation but using the function nsolve but mathematica is not giving me proper answer. The code is given below. ...
13
votes
3answers
872 views

Subtracting two plots from each other after shifting one

I have the following lists representing energy spectra that need to be subtracted from each other to produce a difference spectrum. ...
0
votes
2answers
189 views

Exporting and Importing solution sets from NSolve

I have a rather large data set that I need to solve for, then save to my hard disk and import in the same format at a later time. This proves to be tricky. I use ...
1
vote
1answer
67 views

FindDistributionParameters and Test Options

This is very much related to my earlier post FindDistributionParameters and Hypothesis Testing. However, I did not get a satisfactory anaswer and it keeps bugging me. I am trying to get help this time ...
7
votes
0answers
198 views

What is a good way to code long, complex, compilable algorithms?

The functional paradigm of the Wolfram Language used in Mathematica is all around wonderful. For intense numerics, Mathematica comes with the ability to Compile ...
0
votes
0answers
86 views

Setting UserBaseDirectory for custom packages

Is there any reason to set $UserBaseDirectory to be anything other than the default? On my mac its set as ~/Library/Mathematica...
3
votes
1answer
55 views

How to unset an notebook option programmatically?

This question is related, but not identical, to this one. Suppose one sets a notebook option like this SetOptions[EvaluationNotebook[], Foo->Bar]; ...and ...
0
votes
0answers
45 views

Is there a way to fully restart a Mathematica session from the front end? [duplicate]

Sometimes my Mathematica environment gets sufficiently fouled up that a full restart is the best way to move forward. By "full restart" I mean the equivalent of running ...
2
votes
0answers
60 views

Export Tube with VertexColors to 3DS

I would like to export a Tube object with VertexColors defined to 3DS format. Here's a minimum example: ...
2
votes
1answer
71 views

How to choose variables of specific form

I am trying to work on a problem with a probability distribution. I wanted to get the result in analytical form. Suppose I need to keep p1, p2, p3, p4 variables such that p1+p2+p3+p4=1; How to use ...
3
votes
1answer
68 views

Recognising degenerate maxima in a matrix

Say I have the following matrix $\left( \begin{array}{cccccc} 1. & 0 & 0 & 0 & 0 & 0 \\ 0 & 0.707107 & 0 & 0 & 0 & 0.707107 \\ 0 & 0.707107 & 0 &...
1
vote
1answer
97 views

Solve for a variable using expression involving sum of quantities

I am trying to solve for h1 using function solve as in below code, Expression in solve equates sum of two expression. Both left hand and right hand side of expression is the sum of four quantities ...
2
votes
1answer
120 views

What's the difference between functions and replacement?

I used to thought that calling a function is equal to applying a rule, i.e. applying a rule of f[x_]->sth. is equal to calling a function f with definition f[x_]:=sth. However, given ...
0
votes
0answers
71 views

Isolate graphic components in Manipulate

I have cobbled together two Wolfram Demonstration files to produce the code below. My objective is to generate the phase plane plot on the left side of the output by clicking in one of the regions of ...
0
votes
1answer
77 views

repeat calculate [closed]

I want to calculate the below program x[t+1].But I can only calculate t=0,1. please tell me how to calculate t = 0 to 10. ...
2
votes
2answers
275 views

Solving coupled first-order autonomous differential equations

I am trying to run a simulation of a circuit to observe chaotic behavior, and have obtained a set of differential equations from an analysis of the circuit. I thought perhaps I could produce a plot ...
1
vote
0answers
113 views

How to Implement a “Function Object” suitable for NDSolve and Finite Element Method?

I have a bunch of methods that shoud return an expression that behave like a function, i.e. an expression that, when supplied with suitable arguments, evaluate to something. A simple ...
12
votes
2answers
157 views

How to properly generate messages from LibraryLink function?

I'm currently using WolframLibraryData::Message to generate messages from a library function, like this: ...
0
votes
2answers
132 views

Plot a histogram according to a set of rules using data from two tables

Let's say I have two Tables A={1.0,2.3,1.5,3.0,1.1,} , B={2,10,3,1,0} and I'd like to plot a histogram in the following way: ...
5
votes
1answer
94 views

How to feed parameters obtained from direct 3D manipulation back into Manipulate's controls?

Here's a simple example of using Manipulate to interactively change the viewer's point-of-view for a 3D graphics object: ...
1
vote
3answers
132 views

Plotting entries of one table vs entries of another with a condition on a third table

I have three Tables, say, A={1,2,3,4,5}, B={1,2,3,4,5}, C={1.1,2.2,17,1.5,5} of the same ...
0
votes
1answer
64 views

Setting a range of values to one value [closed]

My question is perhaps worded a little vaguely, but it's a problem I'm running into defining my own function. I'm drawing some shapes with variable height, and sometimes this height is 0. For it still ...
0
votes
2answers
51 views

Troubleshooting Program Meant to Swap Elements

I wrote a program that is supposed to take a list (of arbitrary length) of pairs of the digits of binary numbers (e.g. ...
1
vote
1answer
80 views

Make a column of two plots

I'm trying to plot a pair of functions of the same variable one above the other. A simple example is ...
9
votes
0answers
150 views

Confused by the opts : OptionsPattern[ ] pattern

I'm trying to make sense of the syntax in the clause opts:OptionsPattern[], as found in this standard "rule-based" (pseudo-)function definition pattern: ...
6
votes
1answer
255 views

What are some useful (or hidden) properties of MeshRegion?

There is quite a bit of powerful functionality built in to MeshRegion, but it seems to be lacking in some areas. For example: extracting a list of edges that live ...
6
votes
1answer
98 views

SameQ for unsorted lists

I have to compare two or more lists and check if they are the same, but their elements can be in different position. For instance ...
0
votes
1answer
92 views

Can one upgrade versions directly from Mathematica front end?

The copy of Mathematica I use I get through work. Upgrading this copy is always I time-consuming, pointless chore. I think all of it could be automated. Which makes me wonder: Is there any way to ...
4
votes
2answers
168 views

Longer ticks without specifying the ticks itself

I know similar questions have been asked here before, but i can't figure out this specific problem. I have a lot of plots that i'd like to bring to a publishable form, but in my current customization ...
3
votes
0answers
80 views

simplify expressions into sum function

Is there a way to have Mathematica simplify long expressions involving sums of variables into expressions using a sum function? Suppose I have something like this: ...
0
votes
1answer
136 views

How to remove the list bracket in some expression?

I have two problems with the List bracket {}. First, I want to get a specific component of LeviCivitaTensor, so I should use ...
0
votes
0answers
35 views

How to change the texture of the graphical objects? [duplicate]

I would like to make a number of 2D figures with Graphics[] command, e.g. Disk[], Rectangle[] etc. It is easy to change the colour and opacity, but I would like to have the internal area shaded with ...
0
votes
2answers
154 views

Find fit does not find the best fit

Here is my data ...
1
vote
1answer
77 views

Powerset Animation/Invisible Vertices/Graph Layout

I wanted to visualize the cumulative powerset construction process and came up with two functions: ...
2
votes
2answers
153 views

How to plot a quarter disk with specified height?

Kind of important: the solution posted does work, and answers the question in that sense. However, it is very slow, so a faster option would be much appreciated. I'm trying to create the following ...
15
votes
1answer
752 views

Is it possible to extract data from an eps plot not generated in Mathematica?

I want to extract data from an eps plot not generated in Mathematica and replot it. In general is it possible to extract data from plots in any formats in Mathematica? I searched but unfortunately ...
9
votes
1answer
431 views

Laplacian and DiracDelta

It is known that: $\nabla^2 \dfrac{1}{|r-r'|} = - 4 \pi \delta^3(\vec{r}-\vec{r}')$. If I do that with Mathematica, I find: ...
9
votes
2answers
184 views

How to speed up Select with MemberQ for large lists?

I have two large lists: list1 and list2. I would like to select elements of list1 only if they appear in list2. Since the list1 has dimensions of (335000, 2) and list2 : (122000, 4), it's taking a ...
5
votes
2answers
351 views

DSolve returns a “wrong” solution

This wrong solution exists from mma9 to mma10.1: ...
9
votes
1answer
162 views

Kernel Crash while using “ValuesOnGrid” method of InterpolatingFunction

Bug introduced in 10.0.0 and fixed in 10.2.0 I was experiencing some kernel crash while using "ValuesOnGrid" method of an ...

15 30 50 per page