instruction stringlengths 43 28.1k |
|---|
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}^... |
How can I determine a matrix $R$ in matlab such that, given a known matrix of coefficients $A$ gives me back its row reduced echelon form? Obviously I need an algorithm/function that works also with matrices that are not fully ranked.
$$
RA=\text{rref}A
$$
I don't know how to handle this... please can anybody help me... |
I'm developing my own generic Runge-Kutta solver, and I'm currently implementing the adaptive step-size routine. I say generic because I want to be able to test different RK implementations by only passing the solver a Butcher tableau, such as the following.
\begin{array}{c|cccc}
c_{1}&a_{11}&a_{12}&\dots &a_{1s}\\
c_{... |
I am trying to solve the Poisson equation in a rectangular domain using a finite difference scheme with a rectangular mesh.
I have happily generated the matrix system of equations Ax = b which is required to be solved, but when I try to impose Neumann boundary conditions (using ghost cells) of zero gradient I am runnin... |
Using the code from http://math.mit.edu/~gs/cse/codes/mit18086_navierstokes.pdf, I simulated cavity flow with an external force with the boundary conditions on the all 4 sides are $u=v=0$ and $\frac{\partial p}{\partial n}=0$. I just added external force to u direction in the step that calculates nonlinear term
$$\text... |
I have a set of data, $x, y$ and $ z$, each with length n:
$x \rightarrow \{x_{1}...x_{n}\}$
$y \rightarrow \{y_{1}...y_{n}\}$
$z \rightarrow \{z_{1}...z_{n}\}$
$y$ and $z$ are parameterised by $x$:
$y = y(x)$
$z = z(x)$
Problem 1
I wish to find derivatives $\Large \frac{dy}{dx}$ and $\Large \frac{dz}{dx}$.
The 'secon... |
Suppose that we have to find an optimal solution $x^*$ to an optimization problem involving some function $f$, such that $0\in\partial f(x^*)$ where $\partial$ denotes the subdifferential.
Let $(x_n)_{n\ge 0}$ be a sequence generated by some algorithm, satisfying $\lim\limits_{n \to \infty} (x_{n+1} -x_{n}) = 0$, and t... |
I have to solve this problem
$$\left\{\begin{matrix}
y''=4y'+\frac{1}{h}-7y\\
y(1)=1\\
y'(1)=1
\end{matrix}\right. \text{where} \; h=5y'-2y$$
as it were a DAE (I know I could just substitute $h$ into the equation, but this is just an example, because in reality the problem I have to solve is a DAE and more complex th... |
Let say I have N computers and 2 N-by-N matrices distributed across them called A and B. Matrix A is row distributed while B is column distributed. Therefore, processor i knows
A(i,1:N) and B(1:N,i)
Do you know an efficient way to determine if A and B are identical that scales well to many processors? (some kind of ch... |
As far as I know, precision errors become larger as the condition number of a matrix increases.
Consider a matrix-based operator:
$$A = \nabla \bullet k \nabla $$
And a matrix-free operator:
$$\tilde{A} = B_{1} + B_{2} + B_{3}, \qquad B_{i} = \partial_{x_i} k \partial_{x_i}$$
One difference between the matrix-free oper... |
Bengt Fornberg derived a general way to compute the weights for arbitrary finite difference schemes in two papers: his 1988 paper and (better) his 1998 paper.
What are the numerical errors associated with his approach as codified in the 1998 paper? Can the truncation and round-off errors be calculated for double preci... |
There are a number of packages available for generating Continuous Galerkin (CG) FEM meshes (gmsh, tetgen, netgen, etc.), but I have been unable to find one that generates Discontinuous Galerkin (DG) FEM meshes.
I'm currently interested in focusing on the solver part of DG, not the mesh construction, so a package that ... |
According to this article from Wikipedia, the box-covering algorithm calculates the fractal dimension of a graph. The algorithm is based on the concept of distance between nodes; see for example the sentence:
A box consists of nodes separated by a distance $l < l_B$.
The distance between nodes can be defined also for... |
I have a generalized eigen-problem: $A\psi = \lambda B \psi$ with $A$ and $B$ are large (>1000) complex non-Hermitian matrices. I know that eigenvalues with largest and smallest absolute values can be found using iterative approaches like ARPACK. But I am only interested in those complex eigenvalues (not all of them) w... |
When does it typically make sense in programming to be testing the equality of two floating point numbers?
i.e.
a == b
where both a & b are floats.
My naive impression is that one would always test the difference against some tolerance epsilon.
Am I wrong? Can testing the equality of floats be meaningful in certai... |
I want to solve a small (20 $\times$ 20 up to 30$\times$30) system which is not symmetric, not diagonally dominant, and not sparse. Each row contains a modified form of the Legendre coefficient of a set of user specified functions. The difference between between each row is that the functions are raised to a different ... |
I have the following PDE.
$\frac{\partial c}{\partial t} + v\frac{\partial c}{\partial x} - D\frac{\partial^2 c}{\partial x^2} = 0
\\$.
I have discretized it such that i now have
$\frac{dC}{dt} = aC_{i+1} +bC_{i} +cC_{i-1} \\$ (1)
I have been given the following initial conditions:
$\\C=C_0\quad\forall \ 0<t<\tau... |
How can the non-smooth functions be integrated using Matlab? Can the Cash-Karp Method be used? The Dormand-Prince method seems to give an error while integrating a nonsmooth solution.
I am using MATLAB ODE45 for the integration of my ordinary differential equation.
$\{q\}$ is a Column Vector of length 14. The excitati... |
Concerning edge finite element (not nodal element), is there any explicit function (e.g. polynomial) to describe the interpolation within the element?
I've read numerous literatures such as "Mixed finite element methods and application" by Boffi et al, and "FENICS manual (https://femtable.org/)". I could follow the co... |
Suppose I wish to solve the following optimization problem:
$$
\begin{array}{rl}
\min_{\mu\in\mathbb{R}^n} &\mu^\top c\\
\textrm{subject to} & \mu\in C_1\cap C_2\cap\cdots\cap C_k,
\end{array}
$$
where each $C_i\subseteq\mathbb{R}^n$ is a convex set. Furthermore, I have access to projection operators
$$
p_i(x):=\left\... |
Consider the problem $-u''=f$, $u(a)=A$, $u(b)=B$. Everywhere, FEM seems to be introduced by using the case $(a,b,A,B) = (0,1,0,0)$, in which case the term $u'(a)v(a)-u'(b)v(b)$ resulting from integration by parts vanishes. If we divide $[a,b]$ into $a=x_0 < ... < x_n = b$, we'll end up solving an $(n-1)\times (n-1)$ s... |
I'm doing some reasearch on electromagnetic nanostructures and I have to solve this differential equation (the exact values of the constants don't matter, I just want all the possible solutions of y(x) given some values to these constants).
$$
\frac{d^2 y}{dx^2}=-\frac{1}{x}\frac{dy}{dx}+\frac{\sin(2y)}{2} (\frac{1}{x^... |
Is there any way to numerically solve the following two-dimensional equation:
\begin{equation}
\nabla_{xy} \cdot \vec{f}(x,y) = a(x,y)
\end{equation}
on a rectangular grid, knowing that $\vec{f}(x,y)$ is zero on the boundaries?
|
Consider the following second-order cone program (SOCP):
$$
\begin{array}{rl}
\min_x & c^\top x\\
\mathrm{s.t.} & \|A_ix+b_i\|_2 \leq c_i^\top x+d_i \ \forall i
\end{array}
$$
Suppose I solve the dual of a second-order cone program (SOCP) for the dual variables $\lambda_i,u_i$:
$$
\begin{array}{rl}
\max_{\lambda,u} & -... |
I'm trying to benchmark a new numerical method for the incompressible Navier-Stokes equations. I'd like to use the most widely-accepted test cases possible. In particular, I'm looking for a reference setup for the 3-dimensional Rayleigh-Taylor instability in a periodic domain. It would be especially helpful if:
The... |
I don't really know where to ask this one...
In fact, I am not sure I can define it properly.
Here goes...
Let's say I take measurements.
In order to "normalize" these measurements, I divide their values by a reference measurement.
So, if my reference measurement has value 100, and one measurement has value 150, I resc... |
Suppose that $\Omega\subset\mathbb{R}^2$ and we define the triangulation $\mathcal{T}_h$ where,
$$\mathcal{T}_h=\bigcup_{i=1}^nK_i$$,
with $K_i$ are triangles.
We have the explicit a posteriori estimator for elliptic problems,
$$\eta_K(u_h)=h_K\|f+\Delta u_h\|_{L_{2}(K)}+\frac{1}{2}h_K^{1/2}\|[n\cdot\nabla u_h]\|_{L_{... |
I'm trying to make a 2D contour plot of a function with a complex input and a real output, namely: $f(z=x+iy)= |z^2-3z|$, on MATLAB. I want to make a contour plot of f, such that the axes are $(x,y)$, i.e. $(\Re(z),\Im(z))$.
How is this done in MATLAB? The problem I'm having is the fact the input is complex.
|
I have a real sparse matrix of the form
$$
\left( \begin{array}{ccc}
h_{11} & h_{12} & 0 & h_{14} & & & \\
h_{21} & h_{22} & h_{23} & 0 & h_{25} & & \\
0 & h_{32} & h_{33} & h_{34} & 0 & h_{36} & \\
h_{41} & 0 & h_{43} & h_{44} & h_{45} & 0 & \dots \\
& h_{52} & 0 & h_{54} & h_{55} & h_{56} & \\
& & h_{63} & 0 & ... |
Given the following optimization problem: Given positive integers $n_1, n_2, \dots, n_m$ and real numbers $P_1, P_2, \dots P_m$. Besides these, given positive real numbers $a_{i,j,l}$ for $1 \leq i \leq n_l$, $1 \leq l\leq m$ and $0 \leq j \leq k$, and we try to find real numbers $(\beta_1, \beta_2, \dots, \beta_k)$ th... |
I was just wondering, in case of computing B=inv(A), suppose I is the identity matrix (diagonal),
After obtaining the factorization A_factorization by computing getrf(A), is it numerically the same to do the following solving steps?
getrs(A_factorization, piv, I)
getri(A_factorization, piv)
|
I've just been introduced to the Poisson's equation. I've never had the need to dealt with PDE, so I'm a bit lost.
Apparently we can compute an approximate solution of the Poisson's equation
$$\frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2} u(x, y) = f(x, y)$$
by discretizing the 2D Poisson's equation... |
Summary: Is there an efficient out-of-place GPU tensor transpose operation that scales as $O(n)$ for tensors with $n$ total elements, regardless of the rank $d$? The naive algorithm costs $O(dn)$, since it requires $O(d)$ worth of index manipulation per entry.
Here is the current implementation of high rank tensor tra... |
Define $S\in\mathbb{R}^{n\times n}$ as
$$S:=H+Q^\top V^{-1} Q.$$
$H,V$ are positive semidefinite. Here, $H$, $Q$, and $V$ are large, dense matrices but they are structured: I can write code for matrix-vector products (e.g. $x\mapsto Hx$) but computing $V^{-1}$ or the map $x\mapsto V^{-1}x$ would require iteration.
Gi... |
I am looking at numerical solutions to the heat equation with Dirichlet and Neumann conditions on the same boundary. That is $u(x,t)$ satisfying
$$
u_t = u_{xx}\,, \quad x \in[0,1]\,, \quad t>0\,,
$$
with
$$
\begin{gathered}
u(x,0) = u_0(x)\,,\\
u(0,t) = g(t) \quad \forall \, t>0\,,\\
u_x(0,t) = h(t) \q... |
Based on this link, in particular Figure 1, what is the exact meaning of the plot?
To my understanding, it implies that for a given differential equation:
$$ \frac {dy}{dt} = \lambda y $$
that the value $\lambda \Delta t$ has to be within the complex region shown in Figure 1 corresponding to which order of Runge-Kutta ... |
Imagine a bus serving a line with N stations. Each station, $i, i=1,…N$, has $s_{ij}$ passengers that want to board the bus to go to $j$, $\forall j \neq i$. (one direction). So there are $\sum_j s_{ij}$ passengers waiting at station $i$ to board the bus. Now, suppose that station $m$, is a strategically important st... |
I was just curious as to why high-order (i.e. greater than 4) Runge–Kutta methods are almost never discussed/employed (at least to my knowledge). I understand it requires greater computational time per step (e.g. RK14 with 12th-order embedded step), but are there any other downsides of using higher order Runge–Kutta me... |
For a 1D grid I can calculate a Lagrange polynomial through an arbitrary set of points for the reconstruction of a polynomial function.
In 2D I have an unstructured grid and want to interpolate the value on one node from the values on neighboring nodes. A difference from the 1D case is that a well-defined Lagrange poly... |
I'm trying to solve the following integral numerically.
$$H(y) = \int dx \, f(x) \, \delta(g(x,y)).$$
For this I chose a representation of the delta-function and employ
convergence with respect to $\eta$
$$\sum_\limits{x_i} \, f(x_i) \, \frac{\eta}{g(x_i,y)^2+\eta^2}. $$
I calculate this for every $y$ such that I can p... |
Let $A$ and $B$ be two rigid transformations in 3D space that transform things from global to local coordinates. Let their relative transformation be expressed by $W=AB^{-1}$. $W$ can also be expressed by an element of SE(3): $\omega=\ln(W)$ where $\ln()$ is defined to be the inverse of the exponential map.
I'd like to... |
I have a legacy DG finite element code for which I would like to write some unit tests. As it is written, for 2D problems, each degree of freedom has associated with it a Jacobian matrix (for later transformation to the master element). All elements are straight-sided.
Is there a good way of sanity checking that these ... |
How can a student with zero computing or programming language knowledge, few engineering mathematics knowledge, understand computational science especially Finite Element Modelling (FEM) from engineering analysis point of view. I found out that there are so many branches or approaches to FEM (computational science) suc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.