# All Questions

9 views

### Plot a simple difference equation

I have a simple difference equation: w[t_] := w[t] = w[t - 1] + h w[0] = 0 h = 5 I want to plot this, so I coded as ...
22 views

### Speeding up inversion of symbolic matrices by invoking caching

Is it possible to reduce the computation time taken to find inverse of symbolic matrices USING CACHING TECHNIQUES accessible (if any)? I am trying to compute inverse of symbolic matrices of size ...
54 views

### Why do Solve, NSolve, and FindRoot all fail on this simple, solvable actuarial equation?

If we express conditional mortality as a vector of annual probabilities of death, like so ...
21 views

### Clear all definitions whenever I experiment with new parameter values?

Do I have to clear all definitions whenever I experiment with different parameter values for my model? For example, I have a simple model as follows: ...
54 views

### How to change display of axis unit from radians to degrees in a plot

Is there a simple way, besides changing my function to use Degree as input, to display the x-axis in degrees in a plot of a function defined with its independent ...
25 views

### Inheritance in Mathematica using pattern matching on UpValues

I have read some posts here on object oriented programming as well as many pattern matching posts, but nothing (I have found) seems to address this case, so I thought I'd ask a question. I am trying ...
12 views

### Want Mathematica (instead of CDF Player) to launch by default when accessing .nb files over the Web

I have both Mathematica and CDF Player installed on my machine. I'm trying to access a Mathematica notebook over the Web and want Mathematica to launch when clicking on the link. Instead, the file ...
18 views

### Set Page Width of PDF

I have a very simple question. I am using the student version of Mathematica 9, and I often do my homework in it. I type up a notebook, and then save it as a PDF using the "save as" option. However, ...
29 views

### How to store standard plot settings? [duplicate]

If I plot many graphs with some standard set of options. Is there a way to store this set so that i can have better overview/structure over my plotting commands? example, I plot a function f[x] with ...
14 views

### OpenCL pass local memory

I've got the following OpenCL function: __kernel void mergeSort(__global const float * in,__global float * out, __local float *aux) When I try to call it, I only ...
49 views

### Working with functions

I am required to write a function that takes a function as a parameter. ...
31 views

### Recurrence Relation construction

How can I go about setting up a recurrence relation where the first 10 values are a constant and the second 10 values are another constant? Ideally, I'd like an efficient way to set ...
24 views

### Manipulate wrapping ParametricPlot3D - part spec longer than depth of object?

I have a system of parametric equations ...
27 views

### Frontend displays wrong number digits [duplicate]

How do I change the default precision in Mathematica? Somehow the setting has been changed to 1 digit, so if I type Timing[...] I get {1., ...} which is ...
38 views

### Problem with the i in mathematica [on hold]

I am having problems with complex numbers. When I do a series e^ix, it gives me back e^ix not the series, not that this example is important, because I already know what it is. But I have other ...
37 views

### Access element in multi-dimensional list [on hold]

Given a matrix index p = {1,2} and a matrix a = {{1,2,3},{4,5,7}} is there a shorter/better way to get the corresponding element ...
36 views

### Problem with SystemGraph and CombinatoricaGraph functionality conflict

I'm trying to generate a random geometric graph. When evaluating HighlightGraph, even if I am passing graph object Mathematica always gives error like A graph ...
37 views

### Log does not reduce expressions [on hold]

When solving an analytical expression, I need to take the Log of something. However, Mathematica seems unable to reduce a simple Log of an exponential: ...
48 views

### Simplify looks ugly

I use Simplify mostly to make expressions look neat. However, Mathematica often does not produce expression in, what I consider, the optimal way. Look at this: ...
94 views

### the different way for a drunken man go back home in determined number of steps

A drunken man walks in a two-dimensional grid.He can walk rigth(1),down(2),left(3),up(4).After determined number of steps,for example,6 steps,he has 400 ways go back home(the number of 1(2) equal to ...
182 views

### Finding elements from a sparse matrix

I am dealing sparse matrices of very large dimensions. I need to locate the positive and negative elements of the matrices and make lists of their corresponding positions. Of course I can write a ...
32 views

### Symbolic probability theory derivations

$\tilde{X}$ is an arbitrary random variable. Let $f(x) = x - bx^2$ and $g(w, x) = a (1 + w\tilde{X})$. I am trying to maximize $f(g(w, \tilde{X}))$ with respect to $w$. It is trivial to see that the ...
61 views

### Limit of sequence

I tried to calculate the following limit $$\lim_{n\to\infty}n\sin(2\pi en!)$$ Mathematica gets ...
71 views

### Nested list to graph

The following nested list can be regarded as a representation of a (tree) graph: ...
38 views

### how to solve 4 unknown by 4 anequtions? [on hold]

(∂ ln⁡L)/(∂µ)=-λ/σ ∑(i=1)^c▒〖∑(j=1)^(n_i)▒g(z_(i(j)) ) +1/σ〗 ∑(i=1)^c▒〖∑(j=1)^(n_i)▒z_(i(j)) =0〗 (1) (∂ ln⁡L)/(∂τ_i )=-λ/σ ∑_(j=1)^(n_i)▒〖g(z_(i(j)) )+1/σ〗 ∑_(j=1)^(n_i)▒〖z_(i(j))=0〗 (2) (∂ ...
27 views

### How can I compute and graph a recursive 3D parametric equation after each iteration?

Basically, I have a function defined by $A(x,y,t+1)=A(x-1,y,t)+A(x,y-1,t)+A(x+1,y,t)+A(x,y+1,t)-A(x,y,t)$, with initial condition $A(x,y,0) = \cos(i)^2, x = \cos(i), y = \sin(i)$. I can graph the ...
37 views

### Applying rules to rewrite expressions that contain patterns

I'm trying to write a rule that can rewrite a pattern that exists in another expression. For some reason, this is proving to be more challenging than I expected ... most likely because I'm not totally ...
1k views

My code is: ...
89 views

### How to make sure Table or Do only runs through specific values?

I often need to generate or run through very large numbers of integers (we're talking {i, 1, 10^9} and higher) and want to add certain integers to a list, say ...
72 views

### Which operating system is more suitable to do numerical analysis with Mathematica?

I often have to some numerical analysis which will take a long time. I have Windows and Ubuntu installed now, the performance of Ubuntu is better than the one of Windows at the most time while ...
36 views

### Travelling Salesman Problem Graph Implementation for the Shortest Path [on hold]

My group's having a hard time finding a solution on TSP using graph implementation. I have our code here but it just shows the visited path and final cost. Some help please? Thank You :) ...
48 views

### Having trouble assigning the result of a Solve to a function

Can anyone see what is wrong with my syntax? It looks like I have successfully assigned the result of Solve to a function. I want Mathematica to return me an numeric value of the function ...
52 views

### mathematica apply list of functions to the same arguments [on hold]

How can I apply list of functions to the same arguments? e.g. ApplyFun[{fun1,fun2,fun3},{arg1,arg2}] I looked here and could not find: ...
29 views

### Convert variable into function

Sorry if this is a duplicate, but I have a variable called H. H is some complicated function of ...
35 views

### How to change the order of the variables in an output? [duplicate]

I have this output: a(b + c)d + 3 But I want it to become like this: ad(b + c) + 3 How can I do that? Is there a way ...
46 views

### Is there a faster way to do Normal[SparseArray[{{1,1,1}→1.2, {1,1,2}→20.2, …, {m,n,p}→0.3}]]?

I have a list of the form {{1,1,1}→1.2, {1,1,2}→20.2, ..., {m,n,p}→0.3} and I want to create an $m \times n \times p$ array, $A$, where the value of $A[[i,j,k]]$ is ...
28 views

### How to apply an rule to factors matching a certain form

Suppose we have many expressions involving irrational ArcTan expressions (such as ArcTan[Sqrt[3],5]) along with other irrational factors (such as ...
24 views

### new kernel for notebook

I know I can create a new kernel for my notebook from the evaluation menu but is there a command for this? I'd really like some of my notebooks to startup their own kernel as the first line of code.
25 views

### Why does MemoryConstrained have an upper limit on the constraint?

When evaluating MemoryConstrained for a large memory limit: MemoryConstrained[Print["aaa"],10^10] I get: ...
73 views

I have ...
39 views

### Why does one of my Manipulate integer variables get turned into a real?

I'm developing code for manipulating graphs. Spot the difference in the 2 Manipulates below: ...
58 views

### Time Varying Payoffs?

I'm trying to write some code that will return the final value of an annuity whose monthly payouts may or may not be constant each month. Right now I have working code for constant payments, but I'm ...
323 views

### Fast way of finding position of Interval containing an Integer

I have a large list (about 2.2 million) of pairs of integers. Each pair defines an Interval[{}]. Given some integer x, I need to ...
37 views

I evaluate ...
43 views

### Forming a list out of a solution [on hold]

I have two lists: listcs that depends on a variable y, and listex, which is a list of ...
27 views

### is there a way to construct a pattern that would trigger when an expression is used as a held/unevaluated in some form?

For example, consider the following code f[x_] := (Print["evaluated f"]; workWith[x]); We use it, then f evaluates: ...
36 views

### Using Sum to define a function [on hold]

I'm new with Mathematica, I tried to define C[n_]:=Sum[c[i],{i,1,n}] but I get \$Failed. Not sure what am I doing wrong here... Thanks for any help.
61 views

### Repeatedly evaluating a function [on hold]

I'm relatively new to Mathematica, so forgive me if this is overly simple. I'm trying to evaluate a function several times using different integer values for one of the parameters each time and then ...
39 views

### Hide MathKernel Tab on Taskbar when using C++ [duplicate]

I am connecting to MathKernel.exe using C++ via MathLink on Windows. Hence, to create the link, this is what I use: ...
24 views

### Wavelet Decomposition using daubechies [on hold]

I am trying to use wavelet decomposition technique to extract the fundamental frequency of a signal using simulink. I passed my signal through buffer > DWT > IDWT > unbuffer but there is a delay of ...

15 30 50 per page