Most Popular

1500 questions
16
votes
6 answers

Constraints involving $\max$ in a linear program?

Suppose $$\begin{align*} \min A &\mathrm{vec}(U) \\ &\text{subject to } U_{i,j} \leq \max\{U_{i,k}, U_{k,j}\}, \quad i,j,k = 1, \ldots, n \end{align*}$$ where $U$ is a symmetric $n\times n$ matrix, and $\mathrm{vec}(U)$ reshapes $U$ into a…
N21
  • 161
  • 1
  • 1
  • 3
16
votes
4 answers

Can the solution of a linear system of equations be approximated for only the first few variables?

I have a linear system of equations of size mxm, where m is large. However, the variables that I'm interested in are just the first n variables (n is small compared to m). Is there a way I can approximate the solution for the first m values…
Paul
  • 12,045
  • 7
  • 56
  • 129
16
votes
2 answers

Preconditioning a Krylov method with another Krylov method

In methods like gmres or bicgstab it could be attractive to use another Krylov method as a preconditioner. After all they are easy to implement in a matrix-free way and in a parallel environment. For example, one could use a few (let say ~5)…
16
votes
1 answer

How effective is the 'tendrils of knowledge' approach to Comp. Sci?

I was reading this on Math SE. The basic question is : Assume that someone wishes to study something advanced; one way to do this would be to start off from basics and build up. But the "bigger picture" can get lost in this process. One more method…
Inquest
  • 3,394
  • 3
  • 26
  • 44
15
votes
4 answers

Linear programming feasibility problem with strict positivity constraints

There is a system of linear constraints ${\bf Ax} \leq {\bf b}$ . I wish to find a strictly positive vector ${\bf x} > 0$ that satisfies these constraints. That means, $x_i > 0$ is required for every component $x_i$ of ${\bf x}$. How can I use an LP…
sara
  • 311
  • 2
  • 4
15
votes
2 answers

FeniCS: Visualizing high order elements

I've just started messing around with FEniCS. I am solving Poisson with 3rd order elements and would like to visualize the results. However, when I use plot(u), the visualization is just a linear interpolation of the results. I get the same thing…
Truman Ellis
  • 542
  • 4
  • 10
15
votes
4 answers

Optimal ODE method for fixed number of RHS evaluations

In practice, the runtime of numerically solving an IVP $$ \dot{x}(t) = f(t, x(t)) \quad \text{ for } t \in [t_0, t_1] $$ $$ x(t_0) = x_0 $$ is often dominated by the duration of evaluating the right-hand side (RHS) $f$. Let us therefore assume that…
Florian Brucker
  • 970
  • 1
  • 8
  • 21
15
votes
3 answers

Fortran: Best way to time sections of your code?

Sometimes while optimizing code it is required to time certain portions of the code, I have been using the following for years but was wondering if there is a simpler/better way to do it? call system_clock(count_rate=clock_rate) !Find the time…
15
votes
1 answer

can I trust this numerical triple integral from Matlab?

Computational Science people: I originally posted this question at Math Stack Exchange and someone commented that I might get "much better" answers here: I am a novice at numerical methods and Matlab. I am attempting to evaluate the following sum…
Stefan Smith
  • 515
  • 3
  • 13
15
votes
2 answers

solve $xA=b$ for $x$ using LAPACK and BLAS

I am porting an existing code from MATLAB to C++ and have a linear system to solve $xA=b$ (rather than the more typical form $Ax=b$) The matrix $A$ is dense, and of general form, but is no larger than 1000x1000. So in MATLAB, the solution is found…
NoahR
  • 253
  • 2
  • 4
15
votes
1 answer

Does transforming $J_0(x)\to\int\cos(x\sin\theta)$ help with numerical integration?

I've heard anecdotally that when one is trying to numerically do an integral of the form $$\int_0^\infty f(x) J_0(x)\,\mathrm{d}x$$ with $f(x)$ smooth and well-behaved (e.g. not itself highly oscillatory, nonsingular, etc.), then it will help…
David Z
  • 3,383
  • 2
  • 27
  • 34
15
votes
1 answer

How to to easily reproduce published results in my own articles using my own code

I wrote a program/library which I used to obtain results in an article. (Here it is, but my question is general.) I have tests that I run regularly using ctest (it takes a few minutes to run). In order to reproduce some tables or figures in the…
Ondřej Čertík
  • 2,930
  • 18
  • 40
15
votes
1 answer

PDE solvers for Drift-diffusion and related models

I'm trying to simulate basic semiconductor models for pedagogical purposes--starting from the Drift-diffusion model. Although I don't want to use an off-the-shelf semiconductor simulator--I'll be learning other (common, recent or obscure) models, I…
Weaam
  • 253
  • 2
  • 6
15
votes
3 answers

PDEs in Many Dimensions

I know that most methods of finding approximate solutions to PDEs scale poorly with the number of dimensions, and that Monte Carlo is used for situations that call for ~100 dimensions. What are good methods for efficiently numerically solving PDEs…
Dan
  • 3,355
  • 3
  • 21
  • 47
15
votes
3 answers

What is a scalable preconditioner for high-frequency Helmholtz?

Standard multigrid and domain decomposition methods do not work, but I have large 3D problems and direct solvers are not an option. What methods should I try? How are my choices affected by the following considerations? coefficients vary over…
Jed Brown
  • 25,650
  • 3
  • 72
  • 130