# All Questions

34 views

### Dsolve not working

I am new to using DSolve. In trying to solve a differential equation I was getting nonsense from Mathematica, so I tried to solve an even easier equation ...
68 views

### Is there a built-in function to find the adjoint of a matrix?

I've been looking for a function that helps me get the adjoint matrix o a given one, I found that you can get the cofactors of a matrix but only by using the "Combinatorica" package, which I couldn't ...
57 views

### How to define a Mathematica Function with varying number of input and output arguments [duplicate]

In Matlab, such issue is handled by ...
226 views

### Problem using WhenEvent to constrain solution

Note: This question has also been posted at the Wolfram Community Problem: Simulate pressure in volume 1 and 2 for 1 second. The circuit is as follows: From this I set up the governing DE for ...
69 views

### matrix with IF/THEN condition

How to generate all posible matrices with some conditions on the elements? I need to make for given $n$ all $n\times n$ matrices $A=(a_{ij})$ with three conditions: I. $a_{ij}=+1$ or $0$ or $-1$. ...
61 views

### how to efficiently jump between sections in a notebook?

I have functions defined in some section of the notebook and some cells where I use these functions maaaaany pages below in the same notebook. If I want to go and change the definition of the function ...
185 views

### How can I extract when a select condition is met in a do loop the value of the iterator?

I use the following code to find out the number of consecutive prime numbers using a formula $n^2+n+i$ found out by Euler (starting from n=0): ...
46 views

### Generating a variable size table one element at a time

I can produce a variable size list of strings like AACBBAABC with this code: ...
43 views

### How to evaluate a given table faster?

How to evaluate given function for list to evaluate faster in the mathematica for large number of n (for instance n=6). It evaluates the given function for n=4 in absolute time of 67 Sec in my ...
92 views

### Treat all variables as local in a module

In most languages, any variable defined inside a function is considered local. ...
106 views

### Slow image processing using ReplaceAll

Can anyone explain me, why this line of simple code is so slow? And can it be improved somehow? ...
86 views

### Using mathematica to discover algorithms?

In Steven Wolfram's blog entries, he discusses using mathematica to discover algorithms. I have tried several different google searches for papers on such topics, and have found none. I suspect this ...
108 views

### How to typeset a system of equations with multiple alignment points

I'm aware of how to align a system of equations on the = sign (or other single alignment point), but I'd like to align a system at multiple points so that each variable stays in its own "column" so to ...
422 views

### Whether Wolfram Mathematica suits well for doing app in it instead of C++

At uni I have an yearly essay. I'm allowed to use any technology for implementing it. I've been coding it in C++ with Qt. I thought of about Wolfram Mathematica because I have some expirience in it. ...
151 views

### Reversing every second “row” in a list

I have a list that is obtained by flattening a matrix list=Flatten[Table[{i, j}, {i, 1, 4}, {j, 2, 6, 2}], 1] {{1, 2}, {1, 4}, {1, 6}, {2, 2}, {2, 4}, {2, 6}, ...
59 views

### Converting a date to a calendar quarter

I have a list that includes dates. I need to convert each date to be the last day of the quarter that it's in. So for example I want {2013,7,1,0,0,0} to become {2013,9,30,0,0,0}. Actually I don't ...
47 views

### Fitting a Function With a Numerical Integral [duplicate]

I am having trouble using FindFit with the following function. ...
98 views

### How can I exhibit the evaluation of formulas in a Mathcad-like way?

How can I create a function F that works like this: x = 2 f1 = x^2 + 3 f2=x+5 F[f1] x^2 + 3 = 2^2 + 3 = 7 ...
161 views

### Mathematica crashes X in Ubuntu

I'm using Ubuntu 13.10 and every time I try to start Mathematica, my Ubuntu session just crashes and I get thrown to the login screen. This also happens if I try to run Mathematica from another ...
278 views

### How to enumerate all possible binary associations?

Suppose I have a list of symbols like: {a,b,c,d} I would like to enumerate all possible binary associations (combining symbols and/or sublists pairwise): ...
88 views

### Get interval of series

It seems to be a stupid question but I wonder how to get an interval of a series expansion. The current series command Series[f, {x, x0, n}] only give series ...
63 views

...
50 views

### How to unassign subscript variables assigned using the Notation package

I looked over some related questions (e.g. How to assign (and retrieve) variables with subscripts?) it looks like my question is different. I am using the Symbol ...
158 views

### Differential equations: How do I solve a delay differential equation with 0-1 variables

How do I solve the following non-linear, delay-differential equations using Mathematica under the assumptions $$p(t) = 1 ,\; y(t) > k$$ $$p(t) = 0,\; y(t)<= \ k$$.  \frac{dw}{dt} = ...
66 views

...
64 views

### Function won't compile. Is there a workaround?

Here's a simplified form of a function I would like to compile, but it produces errors ...
81 views

### List of squareful, cubeful, etc. numbers

The following works: ...
60 views

### Rotating a set of 3D points against an arbitrary axis

I want to rotate a list of 3D points around unit vector (1,0,1) by the angle of Pi. How can I accomplish it?
162 views

### How to implement Kemeny-Young method? (rank aggregation problem)

Prehistory I am trying to make some statistical analysis of some experimental data, arises from measurements made ​​on an ordinal scale. I faced with the problem of rank aggregation: to get from ...
42 views

### Extracting solutions from one equation and placing them as inputs of another equation [closed]

I have a very simple equation 2x + y = 10 I want to know which integer combinations of x and ...
71 views

### Want to use column names as indices, but without quotes

The following works: ...
110 views

### Draw an arbitrary convex polyhedron without excess diagonals drawn

I want to draw a set of convex polyhedrons whose vertices are defined by spherical coordinates on the surface of a unit sphere. Currently I followed the advice from here: ...
88 views

### Making a histogram of a user defined random variable

Suppose I want to generate a histogram of $n$ trials a slightly complicated random variable in Mathematica. Is there an easy way to do this? For instance, to make a histogram of a normal variable one ...
37 views

### Draw an arbitrary convex polyhedron [duplicate]

I want to draw a set of convex polyhedrons whose vertices are defined by spherical coordinates on the surface of a unit sphere. How can I accomplish this in Mathematica? It seems I cannot do it ...
85 views

### Plotting two vectors on the unit circle [closed]

I would like to plot a vector on the unit circle, depending on an angle Pi/k, and the same vector rotated by an angle d. I try ...
120 views

### How can I create a colour image using raw black and white data? (FITS data cube)

I have a data cube containing pictures of a galaxy across a thousand wavelengths. I want to take the data for the image slides in the red and blue parts of the spectrum, and have them represented in ...
68 views

### Need Help with Output/Code Optimization Conparative Statics with System of Equations and Matrices

I have a system of equations (equilibrium conditions) and would like to evaluate how changes of exogenous variables affect the endogenous values. In step 1, I state the equilibrium equations and some ...
58 views

### Error Interpretation with NIntegrate, max. possible accuracy/precision

I guess the right question to this is: Which method is used at NIntegrate with Mathematica 8 as default and which is used with Mathematica 9 as default? ...
101 views

### How to constrain the generation of all possible orderings?

Here is code from Simon Woods' answer for getting all possible weak (equal ranks allowed) orderings for $N=3$ objects: ...
130 views

### Block Matrix Algebra with Mathematica

I have come up with some BlockMatrix Algebra for Mathematica to make notations easier. I have the following: ...
113 views

### How to speed up Manipulate with Graphics3D

How do I speed up the Manipulate of the Graphics3D objects here? It is currently painfully slow, and I'm at a loss. I have reviewed many other posts and implemented what I could based on them, but it ...
207 views

### What are the algorithm details of FindRoot?

The Help page of FindRoot says: "by default, FindRoot uses Newton's method (Newton-Raphson) to solve a nonlinear system". But I ...
40 views

### How could I implement, in C++, Mathematica's capability of rationalizing machine reals? [migrated]

If I have a variable x bound to a machine precision real in Mathematica, I can use y = FromDigits[RealDigits[x]] then y is ...
91 views

182 views

### How to make use of an interpolating function outside of Mathematica? [duplicate]

I'm currently working on a project where I have to solve some partial differential equations. Initially, I made some approximations so that an analytic solution could be obtained, and my ...
109 views

### Why DSolve and NDSolve give different answer

Consider these code, which solve the same equation using DSolve and NDSolve, why do they give different answer? Which one is ...
124 views

### Having trouble fitting data using NonlinearModelFit

I'm trying to fit data = {{2002, 45000}, {2004, 90000}, {2005, 120000}, {2013, 211000}}; to an exponential function ...