instruction stringlengths 43 28.1k |
|---|
I work in a field (elasticity reconstruction) that frequently uses standard Finite Element methods to solve the first order PDE, where we are given u and solve for mu and lambda:
$$
(\mu(u_{i,j} + u_{j,i}))_{,j} + (\lambda~div~\mathbf{u})_{,i} = -\rho \omega^2\mathbf{u}_{i}
$$
known as the Navier-Lame equation. Here we... |
I was able to draw to the outer airtight boundary of hole. Now I would like to implement interior flood/fill algorithm. To get an internal seed, only one method comes to my mind which is testing neighbors of red cells for ray casting. However, I would like to know is there a faster method.
|
Suppose i have a bunch of 10 data points and i have to conclude whether the increase is $n^2,n^3,\cdots,2^n,3^n, e^n,\cdots$.
For example i have the image:-
Now the increase is either polynomial or exponential. First question is how to decide that?
Case 1: increasing polynomially, i.e., $n^c$
Then how to find constant... |
I'm wondering if this is a valid methodology to find the best regression equation for a given data set.
User provides a rang of estimated value for some set of variables. Th algorithm uses the given range to randomly generate a large number of regression equations like the one bellow.
Price = actualValue1* estimate... |
I was wondering whether there is a smart and efficient way in Matlab to compute the kronecker product of several 1D arrays.
What I mean is something like this
A = [a1, a2];
B = [b1, b2];
C = [c1, c2];
K = f(A,B,C) = [a1*b1*c1, a1*b1*c2, a1*b2*c1, ... ]
One possible way it is to use the kron(X,Y) function, but it has t... |
I'm facing a non-linear programming problem which currently I'm solving with fmincon function of MATLAB. However, I'm not very happy with computation times and solution convergence since it only converges when setting the algorithm option to 'active-set' and computation times depends heavily on the initial condition.
I... |
The naive summation of a Chebyshev series
\begin{align*}
f(x) = \frac{c_0}{2} + \sum_{k=1}^{n-1} c_{k}T_{k}(x)
\end{align*}
which employs the three-term recurrence for evaluation of the Chebyshev polynomials is known to be numerically unstable near $x=\pm 1$. For this reason, Clenshaw presented an algorithm which avoid... |
I have a mesh with irregular hexaedra and I need a fast way to interpolate values at points inside these cells. I know that trilinear interpolation does not work well for large skews. Barycentric coordinates work for tetrahedrons. Is there any equivalent method for hexaedra, which is really efficient, possibly parallel... |
Some reference in adaptive techniques say that when the solution $u$ is smooth enough we can use p-refinement instead of h-refinement. And when we have for example singularity, we should use h-refinement. I can not understand it. why?
When we use a higher order polynomial for approximation we can get smoother solutio... |
I am assigned to compute eigenvalues and eigenvectors in MATLAB of a 2x2 matrix:
$$
A = \left( \begin{matrix}
3 &0\\
4 &5\\
\end{matrix} \right)
$$
I know that the textbook's solution states that eigenvalue 3 corresponds to an eigenvector $(1 \; -2)$, and eig 5 corresponds to $(0 \; 1)$.
This is what I do. Why am I not... |
When calculating a type-II DCT with FFTW, you create an fftw_plan, via
fftw_plan plan = fftw_plan_r2r_1d(size, in_ptr, out_ptr, FFTW_REDFT10, FFTW_ESTIMATE);
As I understand it, the plan precomputes the twiddle factors so that the plan can be efficiently reused for multiple calls to fftw_execute_r2r(plan, in_ptr, ... |
I see images of steel connections, concrete dams, and other complicated 3D objects in papers which finite element analysis has been performed on them. My questions are:
How these objects are created in MATLAB? Should we give all the points ourselves?
How can we create mesh for them to perform finite element analysis? ... |
I am attempting to use an iterative solver to solve $p$ in
$$
Jp = -r
$$
where $J$ is an $m\times m$ matrix ($m$ is in the order of $10^5$ and never explicitly stored). $J$ is a dense matrix representing a Jacobian for a certain function, and, in general, is not symmetric.
Unfortunately, this is an ill-posed problem an... |
I'm trying to approximate an unknown, non-linear function $f: A \to \mathbb{R}$ (in my case: $A = B \times B$ where $B$ is an infinite but compact subset of $\mathbb{R}$). That is, evaluating $f$ is costly and I'm looking for an easy-to-evaluate function $g$ such that $f$ is close to $g$ on $A$. Given an error bound, h... |
Is there something like a rule of thumb for an adequate time-step size when solving Maxwell's equation for the interaction of light with matter?
I guess a single wave oscillation has to be resolved within at least ~10 steps, which would give a time-step below 1 fs for visible light?
I really hope it's not that bad. Wha... |
I have the following optimization problem:
Given is a set of $n$ points $x_i, \ldots, x_n$ with $x_i \in \mathbb{C}, \|x_i\| < \infty$. Note that $n$ is usually not large, i.e. $n < 1000$. We want to find a point $c \in \mathbb{C}$ such that
$\max_i \| x_i + c \|$ is minimized
Currently, this problem is solved by means... |
I am trying to solve a system of non-linear index-1 DAEs in which the derivatives of the state variables, $x(t)$ are corrupted by additive noise, $w(t)$ (whose covariance matrix is known).
$\dot x(t) = f(x(t),t,u(t)) + w(t)$
Is there a known (open source) solver/library/package/toolbox in MATLAB/Python/Julia (with or w... |
I have written an 2d N-body simulation in Python which allows collisions between the bodies.
A body is modeled as a circle whose area is proportional to its mass. Each time the sim advances by one time-step, I identify which bodies have overlapping radii and I replace them by one particle (respecting conservation of mo... |
In FEM, to discrete the weak form, elements are needed to build the FE approximation basis space. FE method involves integration of the weak form. Due to
discretization, the solution is an approximation close to the exact solution. I have a doubt that if FEM discretization error is mainly the error when us integrating... |
As described in this Wikipedia article, a discrete laplacian matrix can be made for a 3D regular grid using Kronecker products. I'd like to use the same methodology for $(n-1)\times n$ matrices of the form
$$
\begin{bmatrix}
-1 & 1 \\
& \ddots & \ddots \\
& & -1 & 1 \\
\end{bmatrix}
$$
Given 3 of these matr... |
I am modeling the structure of a crystal and need to find what the "lowest energy structure" is. There are three free parameters (let's say, $a$, $b$, and $c$) to change, and the search space, $E(a,b,c)$ is convex. What is the best way to set this up so I vary $a$, $b$, and $c$ to find the combination that yields the m... |
I'm writing a small numerical library for 2x2, 3x3, and 4x4 matrices (real, unsymmetric).
A lot of numerical analysis texts highly recommend against computing the roots of the characteristic polynomial and recommend using the double-shifted QR algorithm. However, the size of the matrices makes me question whether or no... |
I'm trying to understand the passage through this equation can be written for easily solved with the fortran alghorithm in particular i don't understood the meaning of L_x and L_xx ... what (-1,0,1) stands for ?
could somebody explain me ? thanks a lot !
the equation is reported here (explicit scheme is clear .. obviou... |
I have the following set of equations:
$$ x(t) = x_0 \psi, \qquad y(t) = \kappa \ln \psi - x_0 \psi +1,\qquad z(t) =-\kappa\ln \psi,$$
with
$$
t- t_0 = \int ^\psi_{\psi_0} \frac{d\eta}{\eta(1+\kappa\ln \eta + x_0 \eta)}.
$$
Here $t$ represents time. I would like to plot these equations in Python for the time range $t... |
Consistent variation occurs in papers multiple times when reading . So what does it really mean from a maths view? I searched online and found an answer for it. Someone explained it as ‘Solution is consistent if when you plug it to the strong form, the solution satisfies it. For example, a penalty method is not consist... |
I have to repeatedly calculate a function which contains a sum of a large number (~100) of exponential terms:
$f(x) = \sum_{r=1}^{100} C_r e^{b_r \cdot x}$
There is no relation between the $C_r$ and $b_r$ (i.e. something like $C_{r+1}$ = 2 $C_r$).
Does anyone know a fast way to determine a numerical approximation for ... |
I have taken a course on undergrad scientific computing which discussed nonlinear algebraic equations about half-way in, and PDEs at the very end, but never discussed nonlinear PDEs.
However in my research work, we have to use a solver that deals with a nonlinear coupled system of time-independent PDEs and I'm trying t... |
I am implementing a Kalman filter (for a linear ODE system for now).
My model represents a physical device that has 6 "parameters", i.e. those values of the device do not evolve over time (within a time-domain simulation environment for now).
I have 100 such "slightly differing devices", i.e. whose parameter values di... |
I've got a data set of points $M_O .. M_N$ for time points $t_0 .. t_N$, where $N$ is approximately 10-20, and the spacing of time is not uniform (i.e., $t_{i+1}-t_i$ is not constant for all i). It is believed that this data should be able to be modeled by a differential equation of the form
$\frac{dM}{dt} = -k (M - M_... |
I posted a similar question yesterday but I deleted it since I think that I had to reformulate it after some insights.
I want to calculate
$$
\exp(-i\Delta t\,\mathcal{H}) = V\,\mathrm{diag}(\{\exp(-i\Delta t\,\epsilon_k\})\,V^{-1} ~~~~~~~~~~~~~(*)
$$
where $\mathcal{H}$ is a hermitian matrix (the hamilton matrix) and... |
I have a set $N$ points in $d$-dimensional space, $\mathbf{x}_i \in \mathbb{R}^d ~~ \forall i=\{1,2,...,N\}$. How to choose $n$ points from the set such that it maximises
$$
f = |\mathbf{S}|^{-n/2} \exp\left[-\frac{1}{2} \mathrm{tr}\left(\mathbf{S}\boldsymbol{\Sigma}^{-1}\right) - \frac{n}{2} (\boldsymbol{\mu} - \mathb... |
In my problem, I have a lattice with a stochastic cellular automaton. In order to simplify a bit, let's say it is 1D. In my system, each node can be type A, B or C. A way to represent the system and operate fast over it is using an integer 64-bit variable, working bitwise.
Let me give an example of implementation for a... |
I am trying to simulate an ODE, like $ \dot{x} = \xi(x) $ that should have a stationary distribution (a la Stat Mech). Assuming that my ODE algorithm generates time samples of my system state $ x $ like $ x^{(0)}, ..., x^{(t)}, x^{(t+1)}, ..., x^{(n)} $, I would like to verify that the samples generated from the ODE nu... |
I'm working through the book Approximate Dynamic Porgramming by Warren B. Powell. Currently I'm solving exercise 3.3 and 3.5. Let me state the exercise (I'm summarizing the text from the boook)
We have the following Markov Decision Problem. We have a two-stage Markov chain with one-step transition matrix
$$
P=
\beg... |
Consider the BVP: find $u = u(x)$, for $x \in (0,1)$ that satisfies
\begin{align}
u'' + u u' = f, \\
u'(0) = g_n, u(1) = g_d.
\end{align}
To derive the weak form for this BVP, we multiply the first equation by a suitably smooth test function $\Phi = \Phi(x)$ and integrate both sides. This leads to
\begin{align}
- \in... |
I am trying the implement the following odeint solver example but my differential equations are different.
https://github.com/headmyshoulder/odeint-v2/blob/master/examples/stiff_system.cpp
The system I have is stiff so the rosenbrock method is a good fit for that. However, the solution process is really slow, often tak... |
I wanted to implement a basic example from the book "The Art of molecular dynamics simulation" in LAMMPS. It describes the 2d-movement of molecules in a Lennard-Jones-potential, defined as
$$u(r_{ij})=\left\{\begin{matrix}4\varepsilon\left[\left(\frac{\sigma}{r_{ij}}\right)^{12}-\left(\frac{\sigma}{r_{ij}}\right)^{6}\... |
I want some scalar spline function defined on regular 2D grid $F(x,y)$ with continuous first derivative which is easy to intersect with arbitrary ray/line ${\vec l}(t) = (c_x t,c_y t,c_z t)$.
Finding the intersection means finding roots of equation $f_{c_x,c_y}(t)-c_zt=0$ where $f_{c_x,c_y}(t)=F(c_x t, c_y t )$ are ... |
Suppose we have equation of the form:
$$H \Psi = E \Psi $$
where $H$ is Dirac Hamiltonian (also my question can be answered by people who are not familiar with Dirac Hamiltonian but familiar with numerical solution of different eigenvalue problems):
$$ H = \vec{\alpha} \vec{\nabla} + V(r) = H_0 + V(r)$$
and $\vec{\alph... |
How to normalize the CPU time for comparing algorithm execution time on systems with different hardware configurations?
|
I have to solve a least squares problem:
$$
x=\arg \min\|Ax-b\|
$$
where $A$ is a $m\times n$ matrix, $m>n$, and $b\in\mathbb{R}^m$.
I always thought that doing this via QR factorization is better than solving the normal equations
$$
A^*Ax=A^*b
$$
directly.
However, I am now in the situation where the columns of $A$... |
Edit: (copying from my comment)
Let's consider the inverse problem when I need to transfer velocities from particles to the grid (inverse bilinear interpolation). How'd I transfer a particle's x-velocity to the velocities located at cell's face in the Q region? Would the particle's velocity be distributed among the 2 f... |
I'm trying to take data in numpy arrays, interpolate them and retrieve this function to differentiate/integrate at different stages.
Here is how I got here, data included:
import numpy as np
x = np.array([ 50., 55., 60., 65., 70., 75., 80., 85., 90.,
95., 100., 105., 110., 115., 120., 1... |
I am trying to parallelize a program with CUDA that has irregular memory access. To explain what I am talking about, I have attached two figures. In the first figure, I have plotted the indices of the output and input arrays that needs to be accessed during each loop iteration. Obviously I have plotted only a few itera... |
The title says is all. This question is in the contest of an incompressible Navier-Stokes solver.
Specifically, I am currently working on a new solver while referring myself to an older code for guidance. The use of high-order methods - WENO5 for convection and 4th order finite difference other derivatives - is compuls... |
I am solving a first-order ODE:
$\frac{\partial \rho }{\partial t} = -a \rho^2 + b |A(t)|^2 \rho +c|A(t)|^{2m}$
This is the evolution of the plasma density in the presence of a laser pulse (complex amplitude A, which is normalized). The coefficients a, b and c depend on the material and the initial laser intensity. Typ... |
I have solved a PDE with an analytical equation. Through operator splitting I divided the PDE into one PDE and one ODE, using a sequential approach.
Finally for different $dt$, I got euclidian norm of the difference:
Euclidian norm
$dt_1$ $error_1$
$dt_2$ $error_2$
$dt_3$ $error_3$
I would like to know the order of ... |
If I have a system of equations as follows (where $i = \sqrt{-1}$):
$$
\frac {\partial A}{\partial t} = iA^*B - A \tag{1} \\
$$
$$
\frac {\partial B}{\partial z} = AB^* - B \tag{2}
$$
Using the method of lines, in general, I discretize space and solve the system for all time for a particular $z_k$—this transforms the ... |
I'm using the finite element method to obtain the time response of a structure harmonically excited. I'm using a linear displacement function to obtain the stiffness matrix and the consistent mass matrix, i.e., I have this set of equations:
$$[M]\{\ddot x\} + [K]\{x\} = \{F(t)\}$$
What is the best way to apply the boun... |
I'm trying to solve exercises of the book "Computational Geometry in C" by O'Rourke. Could you please help me with this one?
Design an algorithm to find a line $L$ that:
has all the points of a given set to one side
minimizes the sum of the perpendicular distances of the points to $L$ Assume a hull algorithm is av... |
I have a Triangular Plane T given by three points in 3D space $$P_1 = (x_1,y_1,z_1)\\ P_2 = (x_2,y_2,z_2) \\ P_3 = (x_3,y_3,z_3)$$
I want to find the Shape Functions on this plane as $N_1(x,y,z),N_2(x,y,z),N_3(x,y,z)$.
I am totally aware of finding the basis function for
2D but I have no clue on how to do it for the ... |
Why, you may ask?
The Python sympy symbolic library provides solutions to single, linear Diophantine equations in terms of parametric variables. For instance,
{(t_0, -9*t_0 - 5*t_1 + 154, -5*t_0 - 3*t_1 + 77)}
Without worrying about coding details, how can one solve such a system of parametric expressions for values o... |
I have a usual vtk file with a mesh of triangles and a scalar velocity.
I want to obtain this type of plots:
something like an "elevation", but in paraview I just had obtained plane plots like
How can I obtain plots like the first one?
I Edited my message with an example of my vtk file. Note that the points of the m... |
I need to implement the following in python:
For a given discrete time series $Z_t$ ($t={0...T}$), find the smallest $t$ such that:
$$c\sum_{s=0}^t e^{[k(Z_t-Z_s)+m(t-s)]} \geq \frac{p^*}{1-p^*} $$
where $c,k,m$ are constants and
$$P^*=\int_0^{0.5} \frac{(1-2y)e^{-d/y}}{(1-y)^{1+d}y^{1-d}}dy=\int_{0.5}^{p^*} \frac{(2y... |
For the heat equation
\begin{equation}
u_t(t,x) = \nu u_{xx}(t,x)
\end{equation}
for $x \in [0,1]$ with boundary conditions $u(t,0) = u(t,1) = 0$ and initial value $u(0,x) = u_0(x)$ it is easy to show that the "energy" defined as
\begin{equation}
E(t) = \frac{1}{2} \int_{0}^{1} u^2(t,x)~dx
\end{equation}
decays over t... |
Do you know some interesting literature concerning the comparison of Simplex and Interior-Point-Methods referring to linear optimization?
I also read about the possibility of combining both of them but couldn't find much literature on that either.
|
I implemented the Jacobi iteration using Matlab based on this paper, and the code is as follows:
function x = jacobi(A, b)
% Executes iterations of Jacobi's method to solve Ax = b.
assert(size(A, 1) == size(A, 2))
assert(size(A, 1) == size(b, 1))
% matrix with all zeros except the diagonal elements,
% which are those... |
I have a pretty basic question about Lattice-Boltzmann methods. I heard that this is a meshless simulation method. How do you account for obstacles and boundaries in a Lattice-Boltzmann code. Does it work like a $\Delta x$, $\Delta y$ grid ?
|
In the finite element method, in order to use MPI, we need to decompose the domain into sub-domains first. Then my question is whether we can solve each sub-domain using a direct solver?
Of course, unlike solving the entire domain as a whole, we don't get the right solution in one iteration. Will the solution converge ... |
I am trying to approximate the exponential of a matrix. I want to use a tolerance but I am confused as to how to compute the error. Any ideas or hints?
|
For the closed Newton-Cotes quadrature over $[x_1, x_n]$, the coefficients $H_{n,i}$ for
$$
\int_{x_1}^{x_n} f(x)\:\text{d}x = h \sum_{i=1}^n H_{n,i} \; f(x_i)
$$
are given explicitly by
$$
H_{n,r+1} =\frac{(-1)^{n-r}}{r!(n-r)!}\int_0^n \frac{\prod_{k=0}^n (t-k)}{t-r}\:\text{d}t;
$$
see http://mathworld.wolfram.com/New... |
Consider the following regression model :
Y = AX + BU
where the size of Y is $N \times n$, A is $N \times n$, X is $n \times n$, B is $N \times n$ and U is $n \times 1$.
The matrices X,Y and U are kown and the matrices A and U have to be estimated.
Is there an optimal method (in the sense of minimal residual error betw... |
Update: Thank you very much for all of you who answered below. I'm studying each answer now. In the long term, I'm more interested in solutions that work for sparse tensors (sorry I should have mentioned this earlier), but I can use your ideas as a temporary solution (I will need to add more RAM for larger size problem... |
I'm working on a certain problem of slow, non-Newtonian, thin-film flow. This problem can be modelled with the incompressible Stokes equations:
$\nabla\cdot 2\mu(\dot\varepsilon)\dot\varepsilon - \nabla p + \rho g = 0, \qquad \nabla\cdot u = 0$
where $u$ is the velocity, $\mu$ is the (nonlinear) viscosity, $\dot\vareps... |
This is a follow-up to this answer.
Suppose you have a possibly very ill-conditioned matrix $A$, and you compute its inverse with LU/GE to get $X_{\text{lu}}\approx A^{-1}$.
The Newton-Raphson iteration
$$ f: X \mapsto 2X-XAX $$
generally converges to the matrix inverse of $A$.
Does computing applying the Newton-Raphs... |
I have been trying to solve a nonlinear PDE related to structural mechanics (nonlinear Timoshenko beam to be precise). I am doing both h-refinement and p-refinement to reach the solution. The nonlinear equations were solved using Newton-Raphson method and I am comparing my solution (transverse displacement at a specifi... |
I need to calculate the integral of this function
def f(z):
return ((1-2*z)*np.exp(-d/z))/(((1-z)**(2+d))*(z**(2-d)))
Here d is a constant. I am using this function:
import scipy.integrate as integrate
return integrate.quad(f,0, 5)
However, I need to calculate this for many different d values. I tried putting a... |
This example is a dummy example, but it describes exactly whats goes on in my problem.
As a result from some sympy calculation and manipulation i got two arrays
array_1 = ([f_1(x,y) 0 f_3(x,y) ])
array_2 = ([g_1(x,y) g_2(x,y) g_3(x,y) ])
where f_n(x,y) and g_n(x,y) are complex functions. When I prin... |
I have a loop that has a similar structure as give below:
DO WHILE (t < tend)
t = t + dt
DO j = 1,dim
var2 = 0
CALL func_a(param1,var2)
CALL MPI_COMM_RANK(comm(j),rank,ierr)
CALL func_b(param1, var2,rank)
var2 = var2 + 0.5d0*var3(j)
CALL func_c(var3,param1)
var2 = var2 - 0.5d0*var3
... |
Assuming that the underlying algorithm can be ported to multi GPU, what aspects should one consider while porting from MPI (on multiple nodes) to multi GPU (again on multiple nodes)?
Making use of Hyper Q ? Of MPS ? Peer to peer communication ?
For example, if we consider an MPI code that solves for the Navier Stokes ... |
I am trying to solve a LP in which one of my constraints is of the form
$$\frac{A(x)}{B(x)} = 1$$
I transform this constraint into a linear one
$$A(x) - B(x) = 0$$
However when CPLEX solves the problem, this constraint is of the order of ~1.e-5, but the ratio is of the order of ~1.4, which is a large deviation for my ... |
I'm doing some simulations of the Langevin equation, for various external forces. Being told that C's rand() from stdlib.h can introduce bias in my results, I'm using a Mersenne Twister.
Nevertheless, I would like to know (and see) exactly what kind of errors a linear congruential generator can introduce in my simulati... |
I am simulating the wave equation using FEM. For a 2D wave equation, when I visualise my output in Paraview, I see a separate solution in 'x' and 'y' direction for each node on the mesh. Therefore, if I freeze the time, I will have a solution vector of the size: (No. of nodes x 2). This makes sense to me because when a... |
I understand these equations in particular can be solved easily without use of computational methods. Although right now I am concerned with trying to solve these equations using numerical integration strictly.
$$ \frac {\partial ^2 E}{\partial t ^2} = c^2 \frac {\partial ^2 E}{\partial z ^2} \tag{1}$$
$$E(t=0) = \sin(... |
I have a linear system of equations $Ax = b$ where the number of unknowns $N$ is intractably large but the right-hand side has only small support and the unknown $x$ is known to decay exponentially. I hence want to find a sequence of reduced linear systems $A_n x_n = b_n$ with only $n \leq N$ unknowns such that $x_n \t... |
I need to find the roots of a function. I am currently using scipy.optimize.fsolve
def f(z):
return ((1-2*z)*np.exp(-d/z))/(((1-z)**(2+d))*(z**(2-d)))
# d is a constant ndarray of shape(300000,)
# hence f(z) is an ndarray of shape (300000,)
def trap(func,a,b,num): #trapezoidal approach... |
I am reading the paper, http://math.mit.edu/~gs/cse/codes/mit18086_navierstokes.pdf
I want to solve an optimization problem using this Navier-Stokes code as constraining PDE. Now I am trying to add an external force parameterized some input parameter to the method. The method solves the Navier-Stokes equation in 3 step... |
I have to solve the following equation:
$-u_{xx}=1$,
with $x\in(0,1)$ and $u(0)=0,u(1)=0$. I have to solve it with the following numerical scheme:
$\frac{1}{h_k^2}(-\frac{1}{2}u_{k-1}+u_k-\frac{1}{2}u_{k+1})=1$. So I have to use a non-uniform grid. I have done this so far:
n = 4; %Number points
k = 0:n;
x = 0.5 - 0.5*c... |
Is there a single noun that indicates unambiguously (to a computational scientist, at least) "the ordering (row-major or column major) used in an array"?
For instance, the term endianness (or sometimes even the odd-sounding byte sex) refers to whether a word is stored in little-endian or big-endian order, and one singl... |
I would like to solve in Matlab the following optimization problem
$$\begin{array}{ll} \text{maximize} & \bigg\| \displaystyle\sum_{l=1}^{2}\alpha_l \int_{\tau_{m+l-1}}^{\alpha_1\tau_m+\alpha_2\tau_{m+1}}e^{J(h-s)} \mathrm{d}s \bigg\|\\ \text{subject to} & \alpha_1+\alpha_2=1\\ & \alpha_1, \alpha_2 \geq 0\end{array}$$
... |
Given a distributed Epetra CrsMatrix $A$, along with a a list of rows, a list of columns and a processor ID, I would like to extract a sub-matrix $A_{sub}$, all the entries of which should be stored on the specified processor.
I think this may be done with Import/Export object with suitably defined maps but I cannot se... |
In the following staggered grid setting,
I want to solve diffusion equation as a linear system.
$$\frac{\partial u}{\partial t} = \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}$$
For discretization, use central difference for space and backward euler for time, you can obtain
$$\frac{u^{n+1}-u^{n}... |
I have an application in sensitivity analysis of complex system models with moderately nonlinear interactions between arguments
Arguments potentially dozens or hundreds in number
Arguments mostly real-valued but some categorical with a handful of levels (unordered settings) per variable
The outputs of interest are rea... |
I'm trying to perform inference over a subset of the latent variables of a hierarchical hidden Markov model I built.
I've derived the relevant optimization problem, but it's a pretty nasty piece of work, I'm wondering if I have any hope of optimizing the following expression:
\begin{align}
&\max_{z}\frac{\pi_{z_1}}{(\s... |
Good morning
I'm trying to develop an unstructured CFD code to solve Euler equations in a finite-volume (cell-centered) context (learning purposes). I was able to build from a cgns file some basic information for the code. What I have now are:
Node index and its 'x' 'y' coordinates.
Element index and nodes (indexes) t... |
I'm aware that a 2nd order accurate finite-difference method using variable properties for central differencing can be written in a finite-volume type way:
$$ \nabla \bullet (k \nabla f) = \frac{\frac{f_{i+1}-f_{i}}{\Delta x_{i+1/2}}k_{i+1/2}-\frac{f_{i}-f_{i-1}}{\Delta x_{i-1/2}} k_{i-1/2}}{\Delta x_{i}}$$
This discre... |
I want to compute $\Delta f/f$ (as explained in this link, reference 1), but I am not able to do integration as I have distinct values and no function to generate the continuous time based values.
I have a $1\times N$ time series data where $N$ is the total number of neuron response for one neuron, one for each millise... |
First of all, let me set up some notations.
Suppose we have a hierarchy of meshes $\mathcal{T}_0 \subset \mathcal{T}_1 \subset \dots \subset \mathcal{T}_n$. For simplicity I restrict myself here to $\mathcal{T}_H := \mathcal{T}_0 \subset \mathcal{T}_1 =: \mathcal{T}_h$:
$\mathbb{U}_H$ and $\mathbb{U}_h$ are spaces of... |
My goal is to create a numerical solution of 1D-solute transport (Convective-dispersion equation, CDE) to match it's analytical solution based on experimental data. The CDE can be written as (where, C= solute concentration, D= dispersion coefficient, v=velocity, t=time):
$$-v\frac{\partial C}{\partial x} + D\frac{\part... |
[t,y] = odeXX(odefun,tspan,y0)
I have a solver odeXX, and the tspan = [0 0.0001]. It seems that for any ode solver in MATLAB, they integrate by breaking tspan into multiple steps (some adaptive like ode45 and some non-adaptive). But I am looking for the most primitive one--just integrate from 0 to 0.0001 in one step. W... |
I have a PDE that I solve in MATLAB over a 2D domain using the "recommended workflow", i.e. the functions descg, createpde and so on. The solver (solvepde) works and return a solution which looks reasonable. So far so good.
Now I want to take the result and calculate various integrals on it over the whole domain. Mainl... |
I am using CVX to solve an optimization problem. One of my constraints in the problem is
$$M \succeq \eta {\eta}^T$$
where $M$ is a square matrix and $\eta$ is a column vector (both $M$ and $\eta$ are variables). CVX issues the error
Only scalar quadratic forms can be specified in CVX.
I think the error results fro... |
Rather than
gesv -> solve $AX = B$
gemm -> compute $M = BX$,
somehow I feel there are better ways to compute $M$ with lapack/mkl?
|
Unlike finite element (FEM) or finite difference methods (FDM), where the original PDE is transformed into a sparse linear system, spectral methods return a dense linear system. For a large system, it's not practical to use the a direct elimination method, so a natural choice is iterative methods. As far as I know, mos... |
In Hamiltonian Monte Carlo, Hamiltonian dynamics are used to generate new proposals from the current state. I understand why these dynamics are used as opposed to random walk behavior to generate proposals, but I don't understand why Hamiltonian dynamics are used as opposed to any other dynamics. Could someone please... |
The partial differential equation is a combination of the diffusion plus convective transport equations and an adsorption sink. The equation for one-dimensional solute transport model is:
$$\frac{\partial C}{\partial t} = D\frac{\partial^ 2C}{\partial^ 2x}-v\frac{\partial C}{\partial x} - \frac{\rho}{\theta} \frac{\pa... |
I am looking for a kind of modern test set of large nonlinear problems. The only option I managed to find so far is rather dated: http://folk.uib.no/ssu029/Pdf_file/Testproblems/testprobRheinboldt03.pdf
|
What will be the complexity of finding Gini Index of a sorted vector of $N$ values, which is defined as:
$Gini(\mathbf{x})=1-2\sum_{k=1}^N \frac{\mathbf{x}(k)}{\Vert\mathbf{x}\Vert_1}(\frac{N-k+.5}{N})$
|
I have to simulate a cylinder moving in transverse direction due to an external force (no damping). The equation of motion is: $M\frac{d^2Y}{dt^2}+kY = F_Y$
My confusion is regarding $kY$, how to get displacement when the cylinder is not at $(0,0)$ but at an arbitrary position say, $x_c=0.5, y_c=0.5$. The cylinder shou... |
I have to solve this equation
$$\ddot{x}x = -\frac{3}{2}\dot{x}^2 + \frac{\dot{x}}{h} + \sin(t)$$
where $h$ is defined by
$$h = \left(\frac{\dot{x}}{h}\right)^{1/3} + \frac{\dot{x}}{h}$$
My idea is to initialize $h=1$, solve the first equation, calculate a new value for h:
$$h = \frac{\dot{x}}{x\ddot{x} + (3/2)\dot{x}^... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.