instruction stringlengths 43 28.1k |
|---|
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... |
Since the computational complexity of direct elimilation methods for solving linear systems is $O(n^3)$, it's not practical when the number of dofs is large. But how large would you call it a large system? I saw some material saying that 100,000 dofs would be the watershed when you should consider iterative methods. W... |
I implemented a finite difference scheme to solve Poisson's equation in a 2D grid in C. I solve the system by using Jacobi iteration. Everything works fine until I use a while loop to check whether it is time to stop iterating or not (with for loops is easy). On the notes I am following there is written that I have to ... |
I have to solve
$$\left\{\begin{matrix}
\ddot{R}=-\frac{3}{2}\frac{\dot{R}^{2}}{R}+\frac{1}{R\rho}\left [P_{v}(T_{\infty})-P_{0}+\frac{(L\rho_{g})^{2}}{hT_{\infty}}\dot{R}-4\mu \frac{\dot{R}}{R}-\frac{2S}{R} \right ]\\
h=\frac{\lambda}{2R}\left [ 2+\left ( \frac{-6\rho c_{p}\dot{R}}{\pi h}\right )^{1/3}-\left ( \frac... |
I have a data set, composed of points $(x_i, y_i)$ for $i=1,N$. I also have a known function $F$, which maps these points $x_i$ to $y_i$ as such $F(x_i, a(x_i),b(x_i)) = y_i$, where $a(x_i)$ and $b(x_i)$ are unknown functions of $x_i$. What I'd like to do is run an optimization (ideally using Python packages) in order ... |
I recently scaled my dynamic model based on an open source FEM solver, to run a mesh containing nearly 34 million cells successfully on 800 cores. I have very limited experience using commercial software like ABAQUS, ANSYS, FLAC, PLAXIS, etc. So, I was wondering if this can also be easily achieved using such commercial... |
My phd project is heavily related to numerical modeling of planetary atmospheres. In particular now I am dealing with a particular expression of the continuity equation, involving a thermodynamic flux. Equations read
$$
\frac{\partial n}{\partial t} = -\frac{\partial \Phi}{\partial z}
$$
$$
\Phi = -nD\left(\frac{1}{n}\... |
I am a PhD student and my field of study is Quantum Information and Computation in the theoretical aspect. Actually I write the computer codes/program in FORTRAN 90 which are serial codes but now I have to run my codes in supercomputer so I have to learn parallel FORTRAN programming. Is there anybody to guide me from w... |
What is the role of non-symmetric coefficient matrices in the solution of partial differential equations with self-adjoint operators?
Particularly, I'm thinking about time-propagation of a linear equation
$$i\partial_t v =M v$$
where $M$ is self-adjoint. (Or equivalently, without the complex unit $i$ and then $M$ is sk... |
I have to solve
$$\left\{\begin{matrix}
\ddot{R}=-\frac{3}{2}\frac{\dot{R}^{2}}{R}+\frac{1}{R\rho}\left [P_{v}(T_{\infty})-P_{0}-a_{1}t^{2}-a_{2}t+\frac{(L\rho_{g})^{2}}{hT_{\infty}}\dot{R}-4\mu \frac{\dot{R}}{R}-\frac{2S}{R} \right ]\\
h=\frac{2\hat{\sigma}}{2-\hat{\sigma}}\frac{L^{2}\rho_{g}}{T_{B}}\left ( \frac{\b... |
I have a set of numbers, all positive, integers obviously, and what I want to do is divide them in the least possible groups with each group having a GCD bigger than 1. The biggest possible number is 2^64-1. What I also need to do is keep the complexity as low as possible. I am aware that there are a lot of prime numbe... |
So this semester, I'm taking a Finite Element Method course at my graduate school. We started out making codes for 1D bars and came all the way to 8 node solid elements. However, I seem to have run into a wall, as I have made my code and combed through it for the past week, making sure all the shape functions and mathe... |
I am attempting to solve a computational acoustics problem that involves solving an underlying sparse matrix. The size of the problem varies with grid size (3D) and fill-in's obviously make direct solution impractical. Important features of the matrix are as follows:
It is non-Hermitian and particularly NOT diagonally... |
The composite simpson's rule subdivides the interval into n equal subintervals, with n even.
Then
$$\int_a^b f(x) dx \approx \frac{h}{3}[f(x_0) + 4f(x_1) + 2f(x_2) + 4f(x_3) + ... + 2f(x_{n-2}) + 4f(x_{n-1}) + f(x_n)] $$
(where $x_0 = a$ and $x_n=b$, $h=(b-a)/n$)
source
So what to do if given n equal intervals, with n... |
I am trying to put the function
$$ f(\mu,\nu) = i^{\nu-\mu} \sum_{0}^{19} H_{\mu-\nu}(7j) + \delta_{\mu,\nu}\ ,$$
$\mu, \nu =-3,-2,...2,3$ into a 7x7 matrix, where $H$ is the Hankel function of the first kind, and the $\delta$ represents the Kronecker Delta.
How can this be done, on MATLAB?
|
I have an iterative finite difference scheme for the Poisson equation
$$
\nabla^2 u=-\rho
$$
It's the Jacobi method, which has the form (for 1D systems)
$$
u^{n+1}_{i} = \frac{1}{2}(u^n_{i+1} + u^n_{i-1} + \rho_i~h^2)
$$
Is there a similar scheme for the nonlinear equation
$$
\nabla^2u = -\rho ~e^{u-v}
$$
I tried the f... |
I have to solve
$$\left\{\begin{matrix}
x\ddot{x}+\frac{3}{2}\dot{x}^2=\frac{1}{\rho}\left (P_v-a_1t^2-a_2t-P_0 \right )\\
x(0)=5\cdot10^{-6}\\
\dot{x}(0)=0
\end{matrix}\right.$$
I do not know if it may be helpful, but note that $a_1=2.488125\cdot 10^{14}$ is very big while the timespan is very small ($t_f=70\cdot 1... |
I'm working on an inverse problem for my Ph.D. research, for which I'll write the objective functional as
$J(\theta) = E(G(\theta) - u^o)$,
where $\theta$ are the parameters, $G$ is the forward map from parameters to observations, $u^o$ are the observations, and $E$ is some metric of the error. The forward map $G$ come... |
Scipy integration allows us to do ode integration one adaptive timestep at a time and do something to it. However, matlab ode needs us to specify a timespan , and determine the adaptive timestep within, but cannot do things within.
From scipy
ODE.set_initial_value(y0, tlist[0])
numoftimes = len(tlist)
for ii in range(... |
A Comsol study using frequency sweep on electric current physics yields only current density as accessible variables.
I understand the underlying equation used is Ohm's law, i.e.
$$\mathbf{J} = \sigma \mathbf{E}$$
where $\mathbf{E}$ is the electric field, $\mathbf{J}$ is the current density, and $\sigma$ is the conduc... |
I'm a probabilist and need to do a few computations for a rather big linear least squares problem, so I'm trying to optimize the computation as far as is feasible to me.
In computing the QR factorization of the matrix representation $A$ of an overdetermined system $Ax=b$ using the Householder reflections, the commonly ... |
I am making a code for an 18-node (3x3x2) 3D element FEM. However, even though I am (pretty) sure that all the shape functions are correct and whatnot, whenever I try and invert the stiffness matrix to solve for displacement, I get the warning message from Matlab telling me that my matrix is close to singular.
Is there... |
I'm looking for a benchmark for the flow past square cylinder problem in 2D to compare my results. I have found some papers, but it seems that there are different results in different papers. I want to see the streamline and drag coefficient and lift coefficient . So do you know a famous paper which could be seen as a ... |
I have a number of vectors $v_1, …, v_n$ and another vector $w$, that all are linearly independent, but not orthogonal. Let $V := \mathop{\text{span}}(v_1, …, v_n)$. I need to remove $w$’s projection to $V$ from $w$, i.e., I need to find the vector $\tilde{w}$ such that $\langle \tilde{w},v \rangle = 0 ~∀~ v∈ V$ and $w... |
Most Adaptive Mesh Refinement softwares/logic have cubic blocks. I have explored the BoxLib library and it ONLY supports cubic blocks. To be more precise it supports non-cubic blocks at the coarsest grid level but fails to maintain this non-cubic size when the boxes are refined. I wanted to know if there are block stru... |
I am interested with Map and Reduce operations in computer science. I would like to do analogies with Mathematics and especially with Linear Algebra.
Reduce
First, could we say that "Reduce" operation can be translated as a linear form, ie I start from a vector and I get a scalar from the coordinates of the initial ... |
I'm working on a project where I'll need to be able to interpolate scalar potential values at arbitrary points in a 3-D box from a large (potentially millions to billions of points) collection of values that were calculated at points of convenience (roughly randomly and uniformly distributed) that are not on a regular ... |
The Task
Let $z_1, z_2, z_3$ be positive real numbers and define
$$
r(\mathbf{z}):= \int_0 ^\infty (t+z_1)^{-3/2}(t+z_2)^{-3/2}(t+z_3)^{-1/2}\text{d}t.
$$
The task is to compute $r$ numerically in an efficient way. Absolute error on the order of $10^{-8}$ is acceptable.
Attempts at a Solution
In the notation of DLMF 1... |
In my current problem, I am looking for an algorithm to reconstruct the position of multiple points in the 2D euclidean plane with incomplete distance information, $d_{ij}=||x_j-x_i||\in\text{dom}_a$.
E.g. Information is:
$x_i$: $\{d_{ii},d_{ij}, d_{ik}, d_{il}\}\in \text{dom}_a$
$x_j$: $\{d_{ji}, d_{jj}, d_{jk}\} \in... |
Consider the 1D poisson equation
$$
\frac{d^2 u}{dx^2} = -\rho
$$
with Dirichlet boundary conditions $u(0) = u(l) = g$. Using a finite difference scheme, with a 5-point grid $u_1,u_2,u_3,u_4,u_5$ (excluding boundary points $u_0$ and $u_l$), we get the set of linear equations
$$
\left( \begin{array}{ccc}
2 & -1 & & & ... |
I recently asked a question pertaining to the appliciation of Jacobi's method to a semilinear elliptic PDE (Poisson's equation)
$$
\nabla^2u = -\rho~e^{-u}
$$
A more efficient method like the Bi conjugate gradient stabilised method was recommended. I have tested this method out and it is indeed much faster. But I am un... |
Even though i know that i cannot advance the solver ode23tb, which uses TR-BDF2 itself, in just one timestep, i want to set an upper bound on the integration period after which I do something to output and feed the modified output into ode solver again. The upper bounds serve for limiting the timesteps taken in the int... |
I have solved a second order differential equation $\ddot R=f(t,R,\dot R)$ with a piecewise function $$P(t)=\begin{cases}
P_0 & \text{ if } 0<t\leq40\times10^{-6} \\
\frac{(P_0+P_{min})}{2}+\frac{(P_0-P_{min})}{2}\cos(2\pi ft) & \text{ if } 40\times10^{-6}<t\leq60\times10^{-6} \\
P_{min} & \text{ if } 60\times10^{-6}... |
I have implemented a saddle point optimization problem based on the algorithm by Prof. Nesterov, primal-dual[1].
Unfortunately, it doesn't work. It seems it is converging. But unfortunately, not to the optimal solution which I get with some out of the box solver. I am confident that out of the box solver's result is c... |
I want to minimize an energy of the form
$$V_1(\mathbf{x}) + V_2(\mathbf{x})$$
where $V_1$ is much stiffer than $V_2$. When I try to use LBFGS, convergence is extremely slow, as the solution oscillates wildly in the "stiff directions" while searching for the optimum in the non-stiff directions.
Is there a way I can mod... |
Consider a simplex $T$ in $R^d$ with $N_1(T) = \left\{N_i\right\}_{i=0}^{d}\subset P_1^{*}(T)$ be the Lagrange nodal variables (or nodal evaluation). By the Riesz representation theorem, there exist functions $\lambda_{i}^{*}\in P_1(T)$ (which is the representation of $N_i\in P_1(T)$) such that $N_j(\lambda_{i}) = \int... |
The term divergence-free sounds more general and appears particularly in wavelet-related approaches to the Navier-Stokes equations. However I have yet to find a discussion focusing on the distinction, either mathematical or intuition-based, between curl fields and divergence-free fields. Can anyone clarify this distinc... |
In finite element, I can calculate the Lagrangian interpolation shape functions for each degree of freedom in an element, from the the number of nodal degrees of freedom and the number of nodes required in the element, if I know the data points ($x$,$y$ coordinates) required to generate linear algebraic conditions, whi... |
I am trying to implement a stiff ODE solver that uses step doubling with the backward Euler method but I want to make a modification and I am unsure how to incorporate it.
I am trying to solve $y'=f(y), y(a)=d$ and I am using an approximation to $f$ such that $y'\approx F(y),\;t\in (T,T+dt), y(T)=Y$ where
$$F(y)=f(y)+D... |
I have a heat transfer equation in a cube in $R^{100}$: $[0,1]\times[0,1]\times[0,1]\dots$:
$$
\nabla^2 \varphi = f,
$$
with boundary conditions set in a form that in the number of points $p_i$, temperature field should least deviate from observed values $o_i$, or in other words that solution of heat equation should mi... |
I have a 2D (x,y) scalar advection problem that describes net blowing snow ($q$) transport at a point. This takes the form
$$q = A - F*\nabla\cdot(q {\bf \hat u}),$$
where A ($kg\cdot m^{-2}\cdot s^{-1}$) is a spatially variable scalar source term, $F$ is fetch (m) and $\hat u$ unit normal parallel to to the wind direc... |
In my Robust model control, I have got a couple of quadratic Riccati inequalities which need to be solved numerically on MATLAB. My question, Is there function on MATLAB can solve quadratic Riccati inequality or I have to transform it to Linear matrix inequality(LMI) using Schur complement approach and then apply it on... |
I have used ode45 in Matlab. And, it is my understanding that the 4 and the 5 are for the order of the global and local error, respectively. So, the global error is on the order of $h^4$ and the local error is on the order of $h^5$, where $h$ is the step size.
But, then there's an option called RelTol, which you can s... |
I am trying to implement a two level iterator as I will now describe. Basically I have a "vector of vectors" and I want a single iterator that will loop over all the objects in the vector of vectors.
The code below does this but it is a little ugly and I can't declare the iterator inside the for loop. Thus I declare t... |
Consider this BVP with variable coefficients:
$$-\nabla\cdot(a\nabla u) = f\ in\ \Omega$$
$$-n\cdot(a\nabla u) = \kappa(u-g_D)-g_N\ on\ \partial \Omega$$
where $a>0,f,\kappa>0,g_D,g_N$ are given functions. To obtain the variational formulation of this problem, multiply $f=-\nabla\cdot(a\nabla u)$ by a test function $v$... |
My fortran code contains lines like the following
integer, parameter :: dbp = kind(1.0d0)
integer, parameter :: n = 1 000 000
real(dbp) :: x(n), y(n), z(n)
y(:) = x(:) * z(:)
I would like to take advantage (if possible) of some optimised maths libraries to carry out this operation. I have found a lapack routine dgbm... |
I wrote a hybridizable Discontinuous Galerkin code for transient Navier-Stokes flow,
with thanks to Martin Kronbichler and Scott Miller's step-51 code in Deal.II. The main algorithm
is from Nguyen and Peraire's JCP paper(2012).
$$\frac{1}{\nu}q_{ij}+\frac{\partial u_j}{\partial x_i}=0\;\;in \;\Omega$$
$$\frac{\partial... |
I am trying to solve numerically the following 1D EBM:
$C\frac{\partial T[x,t] }{\partial t} - \frac{\partial }{\partial x}\left ( D(1-x^2)\frac{\partial T[x,t] }{\partial x} \right ) + I[T] = S[x,t](1-A[T])$
where $C$ and $D$ are constants.
I want to use the Crank-Nicolson method to solve it but I am unsure how to imp... |
Can the Multigrid method be applied to solve a linear system of equations in the form $Ax=b$, that is not necessarily related to differential equations?
|
I implemented a FEM solver in MATLAB for Poisson's equation in 3D, using hexahedron and sparse matrix for the Laplacian. I was using the backslash but now I have to use a few iterative methods (GMRES with ilu for example). With $N_x$, $N_y$ and $N_z$ (in general, $N$) being the number of elements (50, 100 and 200 as te... |
I am solving turbulent pipe flow with an explicit MacCormack scheme and Wilcox k-omega model. The laminar version of the code had three distinct stability criteria which worked fine after implementation.
Now, the turbulent version seems to have stability problem. I tried to upgrade the stability criteria for the new se... |
I have been exploring finite differences and heat transfer using the 2D heat equation to further expand my knowledge. So far I think it is going well.
I am running into some confusion around grid spacing for the finite difference method.
Basically if I have a metal plate measuring 100mm x 100mm it would seem natural to... |
Is there routine in standard BLAS or LAPACK to set strictly-upper triangular part (the part above the diagonal) of a matrix to alpha?
I do not want to change diagonal elements so laset is not a good candidate.
|
In continuum mechanics, we define the Right-Cauchy-Green Deformation Tensor as
$\boldsymbol{C}=\boldsymbol{F}^T\boldsymbol{F}$
I want to compute $\frac{\partial \boldsymbol{C}^{-1}}{\partial \boldsymbol{C}}$.
In the Wikipedia Article covering Tensor Derivatives, it says that in index form
$
\left(\frac{\partial \bold... |
I have a multi-variate, continuous function $f$ from $R^n$ to $R$, which I can query for its output for any input.
I would like to create interpolation polynomial for it.
In one-dimensional case choosing points is relatively straight forward.
I have error estimation:
$$
f(x)-H(x)={\frac {f^{{(K)}}(c)}{K!}}\prod _{{i... |
Once again, I am not entirely sure how to describe what I am looking for, hence I have a hard time finding answers using Google or any other literal search method.
Let's say I have a time series:
$$(x_1, y_1), (x_2, y_2), (x_3, y_3), (x_4, y_4),\ldots, (x_n, y_n)$$
Let's say I also have 2 key values: $V_1$ and $V_2$
I ... |
We know that the relaxation time is very important in LBM. I have searched lost of papers, but can't find some systematic introductions about the choice of relaxation time in SRT LBM. Could you give some ways or papers to get a suitable relaxation time?
|
I have the following problem. The domain is $(0,1)$ and we consider a uniform triangulation on $\hat{\Omega}$ with elements $K_i = [i/N,(i+1)/N]$ and $X_h^1$ the linear finite element space. I wrote the following affine map to the reference element $\hat{K} = [0,1]$:
$$ x = x_i + \gamma (x_{i+1} - x_i),$$
the following... |
I have a nonlinear system of algebraic equations with a nonlinear boundary condition of the form
\begin{equation}
f'''(x,t) - (f'(x,t))^3 - \alpha(t) f'(x,t) = 0,
\end{equation}
at $x =0$, where $\alpha(t)$ is constant in space but evolves in time. I use sided finite differences to approximate it and Newton's method t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.