Linked Questions

2
votes
1answer
58 views

Functions that remember some arguments while not remembering other arguments

I would like to some programming that is very generic. Particularly I am interested in the following: Let's say I want to write a function ...
0
votes
1answer
63 views

Memoization (or otherwise) for a recurrent definition of a (double) sequence of functions

Beside I've found answers to similar questions (e.g. this), I can't adapt them to my case. I am interested in the following sequence of functions $p_{m,n}(t)$, where $m$ and $n$ are integer: $$ \...
3
votes
1answer
214 views

Recursion with substitution mathematica

When writing out some mathematical equation like we see on the picture here I got the problem of writing out all terms. I know what recursion means and have done recursion for example for the ...
0
votes
1answer
83 views

Create recursive sequence of functions with memoization

I am trying to create a sequence of functions and have it properly memoize the results. The recursive operation is simply convolution, so it possible there is a better way to do this (obviously, if I ...
1
vote
2answers
237 views

Function to Represent Recursive Integral

I'd like to represent the following recursive integral equation to evaluate/graph (for $n\leq3$): $$K_{i,n}\left(x\right)=\int_{x}^{\infty}K_{i,n-1}\left(y\right)dy$$ where $$K_{i,0}\left(x\right)=...
5
votes
2answers
251 views

Only perform a symbolic differentiation once

I want to define a function that involves a differentiation step that Mathematica can do easily, which might be of the form ...
129
votes
8answers
7k views

Can one identify the design patterns of Mathematica?

... or are they unnecessary in such a high-level language? I've been thinking about programming style, coding standards and the like quite a bit lately, the result of my current work on a mixed .Net/...
165
votes
3answers
14k views

Performance tuning in Mathematica?

What performance tuning tricks do you use to make a Mathematica application faster? MATLAB has an amazing profiler, but from what I can tell, Mathematica has no similar functionality.
0
votes
0answers
77 views

Dummy variable in nested integral operator

I am trying to make a nested integral operator where the output function of one step must be applied to the dummy variable to be integrated in the next step. Here my code: ...
0
votes
1answer
116 views

Nested integration

I wish to perform the following nested integral: \begin{align} I_n=\int_{-\infty}^\infty dx_n~f(x_n,x_{n+1})\int_{-\infty}^\infty dx_{n-1}~f(x_{n-1},x_n)...\int_{-\infty}^\infty dx_1~f(x_1,x_2)\int_{-\...
0
votes
2answers
219 views

Super recursive function

I have read about how to define a recursive function using RecurrenceTable but for $u(100)$ you need all 99 previous terms. The posts doesn't help me. I want to ...
4
votes
4answers
501 views

Memoization of a function defined by a recurrence relation [duplicate]

I have a function which is defined by the following recurrence relation $$h_{n}(x)=h_{n-1}(x)+\frac{\mathrm{e}^{-x^2}}{2^n n!}H_{n}(x)H_{n-1}(x)$$ with the initial condition $h_{0}(x)=0$ and where the ...
9
votes
4answers
3k views

Implementing Picard's Iteration for solving ODEs

Picard's Iteration is a way of solving the IVP $$y'(x)=f(x,y(x)), \quad y(x_0)=y_0 $$ It consists of defining the following sequence of functions recursively: $$y_0(x):=y_0 \\ y_{n}(x):=y_0+\int_{...
0
votes
0answers
70 views

Reuse symbolic polynomial

Suppose I have a function that returns a polynomial in x, GetPoly[params_,x_]:=GetPoly[params,x]... but it is quite slow, so ...
40
votes
0answers
2k views

Fast Spherical Harmonics radiative transfer

This is a rather specific question and I apologize for spamming you with some lengthy code. But it could be interesting for some reader and maybe you can help out, so please bear with me. I am using ...

15 30 50 per page