instruction
stringlengths
43
28.1k
I am using nonlinear optimizers such as BOBYQA to train a model with 10-20 parameters. It so happens that some of the parameters have high correlation. Roughly speaking, imagine that you are fitting parameters $a,b$ in a function like this: $f(x)=a\frac{x}{1+|x|}-b\frac{x^2}{1+|x|^2}$ The response to the change in pa...
There's a vast amount of literature about the numerical solution of partial differential equations. But in none of my books or lectures did I find anything about coupled systems. Internet and library research also did not lead to any introductory material. Could anyone recommend a textbook or a paper with an introducti...
I have the following set of linear equations $$a_{m+1,n}+a_{m-1,n}+m(a_{m,n+1}+a_{m,n-1})+(m^{2}+n^{2})a_{m,n}=f_{m,n}$$ Here $m$ and $n$ run from 1 to $N$, so there are $N^2$ equations for the unknowns $a_{m,n}$. Fixed boundary conditions are used such that $a_{N+1,n}=0$ etc. I would like to solve this system numerica...
I have a system of coupled ODEs that I want to solve. The functions are A(x), B(x), C(x). It is a boundary values problem. I am using Matlab bvp4c. So far I am not satisfied with my solutions. For the boundaries that are of interest for me, the solver fail (Matlab return "a singular Jacobian encountered"). For some oth...
I might have some non-linear ODEs that are being solved by scipy.integrate.odeint. However, a parameter at each time step might have to be updated by using a non-DE rule, which uses the results of the ODE solver at each timestep, together with the variable along which integration is being performed, in order to update ...
I am using bvp4c from Matlab to solve a boundary values ODEs problem. Given the ODEs and boundary conditions, is there any way to have more information on the solutions? How many do I expect? 0, 1, several? What am I supposed to understand from the bvp4c error message "singular Jacobian encountered"? No solutions at al...
Please recommend me a well documented C++ library that I could wrap with a mex-interface in Matlab. The library should have the capability to read meshes (optimal in different formats, at least in AVS-UCD-format). To these meshes some operations should be applied: Smoothing, subdivision, reduction, translations, scalin...
I have to choose between the PETSc and Trilinos libraries for a project that involves the solution of non-linear systems of equations. From their web sites they both mention support for GPUs, without giving many details (e.g. here and here). I would like to know which of these libraries is better for GPGPU. In part...
I know the method of constructing solutions. For example I have a BVP: $$ u_{xx} + u = 0 $$ subjected to: $$ u_{x}(0) = f_1, $$ $$ u_{x}(1) = f_2 $$ If I want to check the correctness of my numerical implementation, just plug in $u(x) = \sin(x)$ and then $f_1 = \cos(0), f_2 = \cos(1)$ and then run the script for implem...
So far, I have been using scipy.integrate.odeint as my "workhorse" ODE solver. My current problem requires that I solve a large system (up to ~5000) ODEs. Here's the general workflow of the odeint program, that I have noticed: get initial values and function to calculate Jacobian (or RHS) of the ODE system at $t = t_0...
Currently, my problem requires me to solve a system a large system of non-linear ODEs (up to ~5000). So far, I have been using scipy.integrate.odeint as my workhorse. A simpler subset of my problem only involves ~50 non-linear ODEs. Solving the system over an interval $[0, 10]$ takes about 3 times longer than solving t...
Suppose $A=uv^T$ where $u$ and $v$ are non-zero column vectors in $\mathbb{R}^n, n\geq 3$. $\lambda=0$ is an eigenvalue of $A$ since $A$ is not of full rank. $\lambda=v^Tu$ is also an eigenvalue of $A$ since $Au=(uv^T)u=u(v^Tu)=(v^Tu)u$. Here is my questions: (1) Are there any other eigenvalues of $A$ ? (2) If I have a...
I would prefer recommendations that don't require the use of proprietary tools (such as Matlab). I know of two ODE solving options for the Python ecosystem: PyDSTool (Dopri, Radau, other Runge-Kutta methods, and whatever scipy.integrate.ode has access to) scipy.integrate (scipy.integrate.odeint uses lsoda from the For...
I am aware of a few: a) R project b) Intel® Ordinary Differential Equations Solver Library But, I'd like to know which are the best tools that have been developed by professional physicists and mathematicians. The reason I ask is that I'd like to build an ODE solver myself from scratch but I'd like to be aware of the s...
I'm looking for a library or individual package which provides convenient optimization subroutine for Fortran, any suggestions? I'm testing the codes from Numerical Recipe, downhill simplex method and direction-set method, but the input-output interface is not convenient for chi-squared function, because we generally n...
For a linear system $$ M \dot{u} = Au \qquad \textrm{or} \qquad \dot{u} = L u $$ The generalized eigenvalue problem is $$ A e = \lambda M e $$ We can use the time-stepper approach which essentially computes the eigenvalues of the operator $$ E = \exp(L T) $$ If $\mu$ is an eigenvalue of $E$ then it is related to the or...
I am having trouble implementing a function numerically. It suffers from the fact that at large input values the result is a very large number times a very small number. I am not sure if catastrophic cancellation is the correct term so please correct me if it is. Evidence of something going awry: How can I avoid the ...
I have been playing with an implementation of Visscher's explicit method for solving the time dependent Schrodinger equation (Are there simple ways to numerically solve the time-dependent Schödinger equation?) Presumably if I want to simulate two identical, non-interacting particles I need to duplicate the simulation a...
This question is a search for further answers from a question on maths.stackexchange.com. I've inherited some numerical quadrature code that is designed to integrate sparse 2D data. The quadrature is not being done in any of what I would consider the "normal" ways, but seems to be using an ad-hoc method based on Vorono...
I need to fit a model using MLE with Frank copula by linking two discrete univate distribution function $u = F(x)$ and $v = F(y)$ together, and the joint distribution function is $$ \Phi(x,y) = C(F(x),G(y)) $$ where $$ C(u,v) = \frac{1}{\theta} \log\!\left( 1+\frac{(\exp(-\theta u)-1)(\exp(-\theta v)-1)}{\exp(-\theta)-...
I am working with legacy physical codes and I develop new ones based on the output of them. They all use their own internal normalization of variables (for example all distances are divided by the physical size of the simulation box) which leads to a mess... The goal, I think, is to have all variables near ~1. On the c...
I am a complete beginner in computational fluid dynamics. I have a 3D mesh in Blender representing the object I would like to do my tests on. I can export it in (I think) any useful format for 3D. I would like to know where I can start to make this kind of simulation with SU2 CFD: External flow Air at standard conditi...
In the framework of Finite Element Method, when the Newton method is used, we solve $J(x^k) \delta x = -f(x^k)$, and the increment $\delta x$ would not change some entries from $x^k$ related to Dirichlet boundary conditions. So, I was wondering about the needs to impose homogenous dirichlet conditions in the Jacobian m...
I am doing a nondimensional Navier-Stokes simulation, but it's not exactly clear what values to use for the various gas constants: $R$, $C_v$, and $C_p$. Obviously, once I know one of these and $\gamma$, I can define the others. A colleague of mine is using the formula $$C_v=\frac{1}{\gamma*(\gamma-1)M_\infty^2}$$ but ...
I am looking for a fast (dare I say optimal?) explicit solution the 3x3 linear real problem, $\mathbf{A}\mathbf{x} = \mathbf{b}$, $\mathbf{A} \in \mathbf{R}^{3 \times 3}, \mathbf{b} \in \mathbf{R}^{3}$. Matrix $\mathbf{A}$ is general, but close to the identity matrix with a condition number close to 1. Because $\mat...
Now that Formulize / Eureqa started charging $2500 a year for using it and having crippled the trial version, does anyone know of any replacements that can do similar things like find an equation given data points? It was free, but is now out of the price range of anyone that's not a company or school. (it's a symbolic...
I have tones of geometrical objects (spheres, meshes) I want to render: One way would be to first write a .rib file which could be certainly done and then push that file to a renderman compliant renderer such as the opensource Aqsis render. The problem is this .rib file is soooo massive (1-10gb) that I dont think this ...
Just to be more precise, I'll put a worthy example of my typical use case. Let's say I'm developing a FEM software that produces several temporal solutions and inserts them in an HDF5 file, along with a bunch of correlated data. If I use a naive approach to writing integration tests, I could do like this: Write the co...
I have a bounded non-convex function in 10-dimensional space. The function is quasi-smooth, you can imagine a histogram, here is an illustration, it just shows the idea and not related to my particular function: The function value is obtained by time consuming simulation (it takes about 10 seconds). Obviously if I wan...
I want to compute the expected value of a multivariate function f(x) wrt to dirichlet distribution. My problem is "penta-nomial" (i.e 5 variables) so calculating the explicit form of the expected value seems unreasonable. Is there a way to numerically integrate it? Is there some package (e.g in R) that can let me do th...
I have to solve 4 coupled first order differential equations for $f(t)$ ,$g(t)$, $h(t)$ and $w(t)$ witch are only functions of $t$ , but for every reference link a function of 3 variables is assumed (i.e http://www.phy.davidson.edu/FacHome/dmb/py200/RungeKuttaMethod.htm) I wonder if anyone could enlighten me on this pr...
Given a symmetric positive semi-definite matrix $Q\in\mathbb{R}^{n\times n}$, a vector $v\in\mathbb{R}^n$, a matrix $A\in\mathbb{R}^{m\times n}$ and a vector $b\in \mathbb{R}^m$ I'd like to solve the following optimization problem: $\min_x x^TQx\ \ \text{s.t.}\ \ Qx=(x^TQx)\, v\ ,\ Ax\ge b$ That is, we have a scaled e...
I'm newbie both in calculus and Python/Scipy so I apologize if this question is too dumb. I'm trying to model flow between two pressure vessels. Let's say we have two points and a link between them like this [$Vc_1$, $P_1$]----($A$)----[$Vc_2$, $P_2$] $Vc_1$, $Vc_2$ are constants volumes of the nodes(vessels) and $P_1$...
The interested equation is advection-diffusion equation. One of the canonical example is Navier-Stokes equations. However, I would like to let the coefficient of diffusion constant goes to zero, $\epsilon \rightarrow 0$, while mesh sizes, $ \Delta x, \Delta dy \rightarrow 0 $, and time steps,$\Delta t \rightarrow 0$, d...
I want to minimize function: $f(x) = x^T \cdot A \cdot x + b \cdot x$ given constraints: $B \cdot x = 0$. Here: $x$ is a vector ($x \in \mathbb{R}^n$), $A$ is a matrix of size $n \times n$, $b$ is a vector of size $n$ and $B$ is a matrix of size $k \times n$ (we have $k$ constraints). Without constraint this problem ...
I am looking for library written in Python which will enable me to solve the coupled nonlinear equations which looks like: I need the library which will enable me to couple this solver to other models. For instance, I would like to impose different boundary conditions and change them in time (at any time step) as well...
I am interested in knowing if there is a generalization of the Uzawa iteration for the linear problems of the form $$\left[ \begin{array}{ccc}A& B^T&0\\ B&0&C^T\\ 0&C&0 \end{array} \right]\left[\begin{array}{c}x\\ y\\ z\end{array} \right] = \left[\begin{array}{c} f\\ g\\ h \end{array} \right]$$ Here $A$, is symmetric ...
I am attempting to solve the following ODE problem: $$-u''+ u = x$$ $$u(0) = 0$$ $$u'(1) = -u(1)$$ The exact solution is: $u(x) = e^{-x-1} - e^{x-1} + x$ I have a Dirichlet at $x = 0$ and a Robin condition at $x = 1$. I refer to the exact solution with "little" $u$, and the approximate solution with "big" $U_i$, where ...
Is there a test case for 3D incompressible Navier Stokes Equations like the Taylor vortex in two dimensions? I know, I can easily construct 3D manufactured solutions but I would like to have something more physical.
I am trying to optimize a constrained-problem with a discrete, non-linear objective function. Evaluating this function is also fairly expensive. Nevertheless, despite the above two factors, I hope, that it can still be solved efficiently, since the structure of the constrained parameter space should be helpful. To be ...
I hope to get one smooth curve on one triangle mesh. I get one path on the mesh at first. The path consists of vertices of the mesh. I can see the path from the image below. Each one green dot indicates one vertex on the mesh. The method that I am using is to fit one smooth curve using the vertices and project the smo...
I came across a puzzling remark in the paper P. J. van der Houwen, The development of Runge-Kutta methods for partial differential equations, Appl. Num. Math. 20:261, 1996 On lines 8ff on page 264, van der Houwen writes: "For the Taylor polynomials this implies that the imaginary stability interval is empty for $p = 1...
I am assuming the pardiso solver calculates (or estimates) the condition number before proceeding to the solution phase. Is there a way to make pardiso output the condition number? Alternatively, minimum and maximum eigenvalue are of course also okay. I can also output the matrix in matrix-market format and do the cal...
In my (admittedly brief) experience, there have been instances in which the code got uglier because []*[] == [], and it would be possible to write more elegant code if it was defined to be 0 instead. For an example of such a piece of code, this part is supposed to compute x in L*x=b (L being a lower triangular matrix):...
I'm having difficulties patching together from what I read about obtaining the condition number of a real, symmetric, positive definite sparse matrix. In my code, I found that there is incomplete Cholesky factorization routine (used as preconditioner I suppose). I also have a ILU preconditioner which I could use as Wol...
I am optimizing a function of 10-20 variables by running algorithm such as BOBYQA and a few other derivative-free algorithms. The bad news is that each function evaluation is very expensive, approx 30 min of computation. The good news is that I start in the ballpark of the global minimum, and just a few moves in the "r...
I am trying to use the MPI share memory feature. I have several SMP nodes, and each of them has four cores. I need an array of size N for each node that should be accessed by all four cores in each node. My plan is to construct a shared window of size N/4 using MPI_Win_allocate_shared, and I expect that memory usage of...
For a personal project, I am attempting to write a fairly realistic collision simulator (for relatively large objects, not quantum stuff). As I was consulting my physics textbook and various online resources such as this hyperphysics article, or this one, it appears that all methods for determining collision force (or ...
I'm trying to study with a finite difference method the 2D advection equation with a space-dependant flow. Taking a function $f(x,y,t)$ solution of the equation : $$ \partial_t\,f+\nabla(\textbf{v}\,f)=0 $$ where $\textbf{v}$ is known to be divergence free : $$\textbf{v}=a \begin{bmatrix} \,y \\ x \end{bmatrix} $$ whe...
I'ld like to calculate the PV of an integral with the form $$ \tilde{G}_l(\omega) = -\frac{2\omega}{\pi} PV\int_0^\infty \frac{\tilde{G}_d(\omega^\prime)}{\omega^2 - {\omega^\prime}^2}d\omega^\prime$$ in MATLAB. It is not obvious to me how to do this. I've tried using factorization to change the power in the denomin...
I don't have access to a computer cluster in my university. Is there website that accepts applications for free access to a computer cluster for scientific computing? Further information: I am in Cuba. I need something on the order of 30 processors, about 50 GB of hard drive, for a week or so. I need to run programs wr...
I am a newbie in using LAPACK library. I know that LAPACK's internal rountines break the large problem into smaller problems recursively (I am considering level-3 BLAS). If we consider matrix multiplication C= AB+C example, until what size ( maximum and minimum) we can divide the bigger matrices? (128 x 128) would be...
I am optimizing a function of 10-20 variables. The bad news is that each function evaluation is expensive, approx 30 min of serial computation. The good news is that I have a cluster with a few dozen computational nodes at my disposal. Thus the question: are there optimization algorithms available that would allow me ...
Could you please advise some literature about the numerical method of lines (MOL) for parabolic PDEs? It is a method of solving PDEs with discretizing only by space but not by time. A system of ODEs is obtained and it can be solved with, for example, Runge-Kutta method. Do you know some solvers (programs, libraries) fo...
I often find in the literature some numerical tests use CAD and mesh models. I also want to reproduce their results or test my algorithms on those models. But I am not trained to use CAD or mesh tools. I tried to get cad models from CAD website such as `grabcad'. But I often found it difficult to generate a mesh for a ...
How to estimate the local error and the global error for Runge-Kutta method used for solve a system of differential equations in practice? I use Richardson extrapolation for select a adaptive step [Solving Ordinary Differential Equations I - Nonstiff Problems 167-168p]. I seen the following formula for estimate a glob...
In python I have used the ode method from scipy.integrate. There I used the vodeintegrator and the zvode integrator to solve some numerical odes. I am happy with the solution provided by these methods and would now like to know what the equivalent methods are in matlab. Im not familiar with the intricacies of odes (st...
I am experiencing some frustration over the way matlab handles numerical integration vs. Scipy. I observe the following differences in my test code below: Matlab's version runs on average 24 times faster than my python equivalent! Matlab's version is able to calculate the integral without warnings, while python return...
I would like to solve an equation that looks like this UPDATE $E[(R^{1-\gamma})(r_k+\theta-r_z)]=0$ , where $R=\phi r_z+(1-\phi)(r_k+\theta)$ and $\phi\in[0,1]$, $\theta$, is a random variable normaly distributed with zero mean, and some variance $\sigma^2$. Thus, the $E[.]$ stands for the expectation operator over th...
One of the famous and convenient test cases for shock wave modeling is the 1D Sod's shock tube. This is a Riemann problem for the compressible Euler equations of gas dynamics. The initial set up has been done by dividing domain half with diaphragm. The left and right sides of the domain have initial values chosen to g...
For differential evolution methods in optimization, how many generations does it typically take to reach a global optimum? How do we know if the values are never going to converge?
I can't see any mention of it in job listings. I've seen mentioned integer programming, MIP, mixed-integer nonlinear programming, LP, dynamic programming etc., but no SDP. Is it much trendier in the academy than in industry? From my limited exposure to academics and industry participants in electric power systems, I t...
Could you please advise some programs or libraries for solving parabolic PDEs (or its systems) in 1D, 2D and 3D, for example, with the method of lines? The system of parabolic PDEs can be nonlinear in the right-hand side, for example, $\partial u/\partial t - a\Delta u + u^4 = 0$. Or it is recommended to use only ODE s...
Apologies in advance if this has already been asked before (I suspect it has, but I'm not experienced to know what to call it, or how to classify this problem). Given a set of $m$ points in space, $$\mathbf{X}=\left( \begin{array}{cccc} x_1 & x_2 & \text{...} & x_m \\ y_1 & y_2 & \text{...} & y_m \\ z_1 & z_2 & \tex...
I am trying to use B spline curve fitting. The order of B-spline curve is 4. When I have many control points, it works well. However if the number of control points is small such as two, my program will crash. I realize that the number of control points is related to number of knots and the order. Can anyone help me...
What is the difference between convergence and asymptotic convergence? Why say the convergence is asymptotic?
Is the Crank-Nicolson method appropriate for solving a system of nonlinear parabolic PDEs like $\partial u/\partial t - a\Delta u + u^4 = 0$ ? I tried to apply this method for solving such system but the solution was oscillating (maybe because of a small value of the coefficient of the time derivative) and the implicit...
I need to solve the following hyperbolic equation in x and phi co-ordinates $$\frac{\partial \left ( -s/f \right )}{\partial \varphi }+\frac{\partial \left ( 1/f \right )}{\partial x}=0$$ $$\varphi >0\rightarrow f=\left ( 1+\frac{\left ( 1-s \right )\left ( 1+0.4\varphi e^{-x} \right )}{10s} \right )^{-1} $$ $$\var...
What ODE solvers are optimized for solving stiff systems with sparse Jacobian? Such systems appear, for instance, when a parabolic PDE is discretized in space using typical finite difference or finite element methods.
So, lets say for the family of the explicit Runge-Kutta methods: $$y_{n+1} = y_n + \sum_{i=1}^s b_i k_i$$ where, $$k_1 = hf(t_n, y_n)$$ $$k_2 = hf(t_n+c_2h, y_n+a_{21}k_1)$$ $$\vdots$$ $$k_s = hf(t_n+c_sh, y_n+a_{s1}k_1+a_{s2}k_2+\cdots+a_{s,s-1}k_{s-1})$$ Is there any high-order Runge-Kutta scheme (preferably more tha...
Assume that we have the following equation and the following assumption. The scope is to solve for some particular variables expressed later. Update $$E_{t}\left[ b(A_{t+1})^{1-\gamma} *R_{t+1}^{-\gamma}*[r_k(A_{t+1},a)-r_h(A_{t+1})+\eta)] \right]=0$$ where $R=(1-\theta_1-\theta_2)*r^f + \theta_1*r_k(A,a)+\theta_2 *[r...
So my fellow numerical computational peeps it may be that I am suffering from sleep deprivation but I'm struggling to numerically compute a function $u \rightarrow h(u)$ defined implicitly as follows: $$ u^{h(u)} + u^{-h(u)} = a u $$ for some constant $u$. To be clear, that's just saying $u$ raised to $h(u)$ etc, and t...
Does anyone have any experience on Domain Decomposition using PETSc library? I have used PETSc for creating my vectors and matrix within my C++ code. I also used KSP to solve the linear system. I used following examples to learn about Domain Decomposition in PETSc but they were not helpful: http://www.mcs.anl.gov/petsc...
Does someone know a method to get cheap approximation of harmonic problems (and possibly local approximations)? Let me explain: I need to compute the solution of an harmonic problem \begin{equation} div(\alpha(x) \nabla u) = 0, \quad x \in \Omega \\ u(x) = x,\quad x \in \partial \Omega\end{equation} on a very fine mes...
I want to maximize the sum of Rayleigh quotients: $$\max_x\sum_{i=1}^n\frac{x^\top A_i x}{x^\top B_i x}$$ where $A_i$ and $B_i$ is positive definite. I've found a similar question here: minimization problem: sum of Rayleigh quotients. But it only deals with the case $n=2$, and therefore it seems that the methods there ...
Goal: I need to evaluate numerically an integral of the following form: $$ \int_0^\infty \frac{dx}{(a^2+x)\sqrt{(a^2+x)(b^2+x)(c^2+x)}} $$ where $a,b,c \in \mathbb{R}$ are in the interval $(1,1000)$. This needs to be done in Python. Problem: The integration algorithm does not converge, but I know the integral is conve...
I am modifying a conservative form of the Euler equations with gravity in the energy flux (see previous question: Energy Conservation in Conservation Laws with Source Terms) for use in a Riemann solver. I'm seeing some unphysical/unstable results despite total energy conservation to roundoff. The conservation law equa...
I understand some basic analysis techniques (local truncation error, global error, zero-stable, absolute stable, etc.) of numerical integration. But I find it hard to apply these techniques in practice. In my case (a hair/cloth simulation for computer games), I usually do a numerical integration step followed by constr...
I want to minimize $f(x) = \mathrm{Tr}(\sqrt{\mathbf{X}^{T}\mathbf{X}}\mathbf{A})$, where $\mathbf{X}$ is an matrix variable of dimension $d \times d$, and $\mathbf{A}$ is a known matrix. I tried the following code: cvx_begin variable x(d,d) minimize(trace(sqrt(sum_square_abs(x))*A)) subject to x(s...
I've been taught that when simulating a biomolecule in thermal equilibrium, it's best to use the Langevin thermostat - an algorithm which produces a trajectory, which is a realization of a stochastic process given by the Langevin (stochastic differential) equation. I haven't had a doubt about this algorithm's power to ...
I have two algebraic equations I am trying to solve in Maple. They are: $14\,{a}^{26}{b}^{2}-91\,{a}^{24}{b}^{4}-364\,{a}^{22}{b}^{6}-1001\,{a} ^{20}{b}^{8}-2002\,{a}^{18}{b}^{10}-3003\,{a}^{16}{b}^{12}-3432\,{a}^{ 14}{b}^{14}-3003\,{a}^{12}{b}^{16}-2002\,{a}^{10}{b}^{18}-1001\,{a}^{8 }{b}^{20}-364\,{a}^{6}{b}^{22}-91\...
I have implemented a version of Visscher's method for numerically solving the TDSE (A fast explicit algorithm for the time-dependent Schrödinger equation) (also described in Are there simple ways to numerically solve the time-dependent Schödinger equation? ). $$R(t+\frac{1}{2} \Delta t)=R(t-\frac{1}{2} \Delta t)+\Delta...
I'm trying verify that a 2nd order finite difference in space and time approximation of the 1D wave equation is really 2nd order. My Matlab implementation tells me otherwise - I'm not sure of what I've done incorrectly. For simplicity I've decided to use the smooth solution $u(x,t)=\cos{(ct)}\cos{x}$. The PDE has per...
I am trying to find a good reference on a proper weak formulation for mixed DG (Raviart Thomas and DG) formulation for a Poisson equation with mixed boundary conditions. Can anyone suggest a good reference? Since what follows is lengthy, I am happy to offer a modicum of recompense (of your choice) for good answers. Bas...
I used Gurobi with a MIQP with 26 binary variables and 26*4 interaction term without any other constraint. The speed is very slow already.... I want to ask what is the state of art of MIQP solvers. Generally how many variable can it handle or do we need to manually input linearization techniques to enhance the speed. t...
In combinatorial optimization, there are many problems that can be formulated as either Network Flow model or Mixed Integer Programming (MIP), e.g. supply chains, transportation, and graph-base problems. Some solvers make use of logical and/or graph-base syntax to efficiently solve network problems. And then the Networ...
I'm trying to plot this function func=exp(x-sqrt(2))-cos(x-sqrt(2))-(x-sqrt(2)) in Matlab using 101 evenly spaced x values. If I just say fplot(fun, [-1 3], 'o') the graph is the correct shape but the actual values of the points are determined by Matlab to give the best shape of the graph. I want to tell it exactl...
Sometimes it is meaningful to remove the influence of some old data from a SVD-based model, so as to reflect the most updated trends and provide more accurate results. I've seen there're incremental SVD approaches adding new data, e.g, a simple one is called folding-in. I am wondering is there any inverse operations wh...
My 2D-Poisson solver is build for simulation of semiconductor. The algorithm is Gauss-Seidel iterative method. If I use simple PN junction for simulation testing, it diverged while I applied high voltage on electrode. But it is fine while there is no applied voltage or very low voltage applied on electrodes. The follow...
I would like to get the result of Fresnel-Kirchhoff integral in paraxial approximation to the cylindrical diffracted wave and here is a part of my code and if it is solved gonna be carrying the other parts out. It is a Matlab code. vpa(int(exp(-1i*2*k*(n_cl-n_s)*sqrt(b^2-x_p^2))*exp(1i*k*((x-x_p)^2)/2z),-b,-a)) with ...
I use B-spline curve fitting to obtain one smooth curve. If I obtain two smooth B-spline , how can I connect then smoothly. For example, I have 59 points((x0,y0,z0),...,(x58, y58, z58)) and I have two fitted B spline. One B-spline is for the first 30 points, another is for the next 30 points and the two point set share...
I have a a function $f(k)$ (calculated in Maple) which is huge and stored in a variable called 'sum' on my drive (with the help of 'save' command in Maple). Since the function is huge, Maple is unable to plot it and is taking endless time. Thus, I want to read the variable 'sum' into Matlab and plot it. I am unable to ...
I have a lengthy expression which is calculated using symbolic differentiation of a rather complicated function. I now intend to call this resulting (symbolic function) in a for loop many times, and so I would like to avoid having to perform the symbolic differentiation step every single iteration, rather I would like ...
I am trying to find the minimum of the so called Beale’s function given by $f(x_1,x_2) = (1.5-x_1+x_1x_2)^2 + (2.25-x_1+x_1x_2^2)^2 + (2.625-x_1+x_1x_2^3)^2$ Using Newton iteration $x^{(k+1)} = x^{(k)} - \alpha^{(k)} \eta^{(k)} $ with $ \eta^{(k)} = \left( \frac{\partial ^2f}{\partial x^2}(x^{(k)}) \right)^{-1}\frac{\...
I have been working on a particularly challenging problem and was hoping for some guidance. Here is my problem. I have a point cloud containing millions of points. For each point in the set, I need to determine whether there exists an enclosing circle of radius r that can be drawn around the point (the point can lie an...
I am trying to develop a library for finite element methods in C++ and for that I am looking at the data structures for meshes. Based on what I've read up on fenics and deal.ii, the general understanding seems to be that a basic mesh class should have the following members: Cells, Faces, vertices. Connectivity relat...
If we optimize some parameter using 4 optimization algorithms, 2 of which are population based (say A and B) and 2 trajectory methods (single point search)(say C and D); what statistical test can be used for comparing 4 of these. The initial population of A and B is the same, so is for C and D. However, population size...
Consider the polynomial $$ p(x) = -514-462 x+359 x^2+1129 x^3+165 x^4+490 x^5-418 x^6+497 x^7-227 x^8+60 x^9-10 x^{10}, $$ whose root $A\approx 3.14$ is very close to $\pi$: $$|A-\pi|=2.0746\times 10^{-33}.$$ Let's say I am given as input the eleven integer coefficients above, and nothing else. Is there a way to do ca...
I'm working on my thesis and a part of it has to do with adaptive mesh refinement. As a computer science major, I'm not too familiar with this field. The best way I can put my knowledge of AMR is: I understand the purpose and programming part, but I don't understand what it is. Sorry, I'm having difficulty wording it c...
I read the whole list of this question: Where can one obtain good data sets/test problems for testing algorithms/routines? But the answers are in different areas and I want to ask a specific area. I am looking for resting problems for wave equation, telegraph equation or Klein-Gordon equation, etc. What they have in co...