Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
88 views

Integration involving bessel functions

I want to (efficiently) integrate a function of the form $$ \int_0^a f(r) J_1(kr) \, dr, $$ where $f$ is some function which involves trigonometric functions and where I do not always have $a,k\gg 1$. ...
User's user avatar
  • 21
0 votes
0 answers
128 views

Heat Equation for fast source with FiPy

I'm trying to solve the following differential equation with FiPy, basically laser irradiation on a surface $$ \rho_{s}C_{p,s}\frac{\partial T}{\partial t} = k_{s}\frac{\partial^{2}T}{\partial x^{2}} +...
clope99's user avatar
  • 11
0 votes
0 answers
63 views

Are there any efficient numerical methods to solve the recurrence relation of a function?

First, the recurrence relation is: $$\pi_{k+1}(\omega)=(\omega-\alpha_k)\pi_{k}(\omega)-\beta_k\pi_{k-1}(\omega),$$ where $$\alpha_k=\frac{\int_0^\Lambda\omega\pi_{k}^2(\omega)h^2(\omega)\text{d}\...
Young Q's user avatar
  • 31
0 votes
0 answers
36 views

Fastest way to calculate the eigenvector with the largest eigenvalue for a 3*3 positive-definite matrix [duplicate]

As stated in the title: I have a 3 by 3 positive-definite matrix $M$. What I need is the eigenvector corresponding to the largest eigenvalue, since I am calculating the solution to maximize the value ...
Enigmatisms's user avatar
3 votes
0 answers
53 views

Datasets for inverse heat transfer problems

I was wondering if there is an available, real-life known inverse heat transfer problem dataset to benchmark oneselfs algorithm, as in MNIST for deep learning. Talking about... (well in this case I ...
Aner's user avatar
  • 191
1 vote
1 answer
256 views

Coupled Partial Differential Equations

I'm trying to solve the following system of coupled differential equations, the two-temperature model for $e$ = electrons and $l$ = lattice. $$ \rho_{e}C_{p,e}\frac{\partial T_{e}}{\partial t} = k_{e}\...
clope99's user avatar
  • 11
1 vote
0 answers
50 views

How can I apply a mixed boundary condition to a multi-material heat transfer problem using Crank-Nicolson?

I am working on a mixed material model for a melting material and need to enforce both a Dirichlet and Neumann type condition at the interface. Subject to an external surface heat flux at the top of ...
ZebraEagle's user avatar
0 votes
0 answers
38 views

Thermo Hydraulic Mechanical modeling of energy wall slab in Comsol multiphysics

I am currently working on a complex simulation project involving an energy wall slab, and I need assistance in accurately modeling and validating it using COMSOL Multiphysics. Here are the details of ...
Hizbullah's user avatar
1 vote
2 answers
121 views

How to handle non bilinear weak form?

I solved the 2D heat equation using the finite element method. It all went well first with the adiabatic case, however problems occured when I introduced cooling with the enviroment. I modeled the ...
Boiler4562's user avatar
2 votes
1 answer
453 views

How to leverage the GPU for parallel 3-body problem computations

I have a 3-body simulation which must run millions of times. As far as I know, the GPU shines when it gets to preform simple operations on huge matrices/arrays. Currently I'm debugging and running my ...
Remeraze's user avatar
2 votes
1 answer
411 views

Where am I making a mistake in solving the heat equation using the spectral method (Chebyshev's differentiation matrix)?

I would like to numerically solve the following heat equation problem: $$ u_t = \Bigg(2{a \over l}\Bigg)^2 u_{xx} \tag 1$$ $$ x \in [ -1, 1 ] \tag 2$$ $$ u(x, 0) = 0 \tag 3$$ $$ u(1, t) = A \sin \Bigg(...
FriendlyNeighborhoodEngineer's user avatar
5 votes
0 answers
152 views

Single precision vs double precision conjugate gradients

I tested my conjugate gradients implementation with float and double precision and contrary to my guess the double code was twice faster than the single precision code. The reason is that I need many ...
lightxbulb's user avatar
  • 2,892
1 vote
1 answer
339 views

Why does scipy Conjugate Gradient solver fail to converge for non-steady heat equation using Crank-Nicolson method

Could someone please explain why my implementation of the Crank-Nicolson method applied to the non-steady heat equation won't converge? There shouldn't be any nonlinear aspects to my implementation ...
n1ck94's user avatar
  • 13
2 votes
0 answers
114 views

Efficient heat diffusion implementation with varying coefficients

I have the following heat diffusion equation: \begin{alignat}{3} \partial_t u(t, \vec{x}) &= g(\vec{x})\Delta u(t,\vec{x}), &\quad& \vec{x} \in\Omega, \, t\in(0,\infty],\\ \partial_n u(t,\...
lightxbulb's user avatar
  • 2,892
5 votes
1 answer
107 views

Prediction of sphere (i.e. roast) core temperature heated in an oven

The real-life problem Assume I put a spherical roast with initially constant temperature of start_temp=25 (°C) into an oven with ...
Dieter Menne's user avatar
1 vote
1 answer
309 views

2D Heat equation solved with finite element method converges in skewed way

I tried to solve the 2D heat equation with the finite element method, using triangles as elements. Currently generated by a Delaunay triangulation. The base function I'm currently using is basically ...
Boiler4562's user avatar
2 votes
1 answer
93 views

Best approach to simulating dynamics on networks

I have been recently getting into the field of various processes on networks. For example, stochastic processes like percolation, Ising models, various statistical-physics models; or deterministic ...
YeatTheorem's user avatar
0 votes
1 answer
143 views

How to get a normalized gradient with FreeFem++?

I am trying to use FreeFem++ to solve the heat geodesics algorithm. The algorithm is: solve $\dot u = \Delta u$ at a specific time $t$. compute $X = \frac{\nabla u_t}{|\nabla u_t|}$ solve $\Delta\phi ...
Makogan's user avatar
  • 379
1 vote
0 answers
115 views

Accuracy of the Crank-Nicolson method for non-linear, inhomogeneous heat equation

I am currently coding a solution to the following PDE: $\frac{\partial T }{\partial t} =\frac{\partial}{\partial \theta}(A(\theta ,\phi )\frac{\partial T }{\partial \theta}) +\frac{\partial }{\partial ...
mathbruh67's user avatar
2 votes
0 answers
113 views

Conceptual doubt regarding 2D conjugate heat transfer modelling (COMSOL and Mathemtica)

I have been dealing with some conceptual flaws in my understanding of modelling, which I will elaborate herein. I am modelling conjugate heat transfer of a reciprocating fluid, which flows with ...
Avrana's user avatar
  • 41
1 vote
3 answers
197 views

Inefficient comparisons of custom data type C++

I've got some code that I need to squeeze every bit of both time and space out of. I'm looking for a better solution to the following problem. For reasons outside of the scope of this question, I ...
Michael Jarret's user avatar
0 votes
1 answer
148 views

Problem with my Octave code (unsteady heat equation with FEM)

I want help with my Octave code regarding the unsteady heat equation. My geometry and mesh are generated with FreeFEM++, so there is no problem with that (I tried it with the steady problem with no ...
mibo27's user avatar
  • 3
5 votes
0 answers
109 views

Dense factorization specialized for RBF-FD method

In RBF-FD methods (see Fornberg & Flyer. A Primer on Radial Basis Functions with Application to the Geosciences. SIAM, 2015. Chapter 5.), the finite-difference stencil coefficients for a set of ...
IPribec's user avatar
  • 645
1 vote
1 answer
146 views

Computing pairwise distances in a grid efficiently

I have a spline-based model where I have a set of control points in 3D space. I want to compute pairwise distances between every point on a regular 3D grid and these control points. Is there an ...
Alan's user avatar
  • 23
1 vote
1 answer
168 views

Efficiency of developing PDE solvers using sparse matrices versus loops

I am new to solving PDEs, but have been looking at different implementations of finite difference and finite volume schemes. One thing I have noticed in different implementations is that some ...
krishnab's user avatar
  • 297
2 votes
0 answers
92 views

How to accelerate the computing of implicit finite difference method for heat conduction between two solids

Edit on May 3rd: I have found the problem. Because the difference of between $k_1$ and $k_2$ is huge, a very small time step need to be chosen so that the right green part can "feel" the ...
Kai Jiao's user avatar
2 votes
0 answers
294 views

Rosenthal equation for multi track

Rosenthal's equation lets one calculate the temperature profile of a moving point heat source analytically for thin and thick plates. For simplicity I use the equation for thick plates defined as: $$T-...
vydesaster's user avatar
1 vote
1 answer
2k views

How to solve heat equation in spherical coordinates with finite differences?

I have a problem dealing with heat transfer which is spherically symmetrical. I was thinking it should be possible to solve this as a 1d problem in spherical coordinates using the radius only. ...
Alex I's user avatar
  • 111
4 votes
1 answer
727 views

Incomplete Cholesky preconditioner for CG efficiency

I am currently solving the harmonic equation using a P1 FEM discretisation. The resulting matrix $A$ is SPD and fairly sparse so I use a preconditioned conjugate gradients (CG) solver to find a ...
lightxbulb's user avatar
  • 2,892
-1 votes
1 answer
98 views

How asymmetric encryption is done very fast [closed]

In any asymmetric encryption specifications, there is a step where we need to calculate data ^ public_key mod e to get ...
Hossein Alipour's user avatar
2 votes
1 answer
412 views

Solving stiff ODEs: Dealing with Jacobian terms which take too long to compute with finite differences

I have a system of PDEs describing atmospheric chemistry and transport. I use finite-differences to make my system of PDEs into a system of ~10,000 ODEs. I then integrate the ODEs forward in time with ...
nicholaswogan's user avatar
3 votes
1 answer
541 views

How can I extract the banded or block diagonal part of a sparse matrix in MATLAB?

Given a large sparse (square) matrix in MATLAB, how can I extract the banded or the block-diagonal parts (of fixed size) of it efficiently? These are useful operations when prototyping and testing ...
Abdullah Ali Sivas's user avatar
4 votes
1 answer
139 views

Solving geodesics on triangular meshes gives negative distances

I have implemented the heat method for geodesics: https://www.cs.cmu.edu/~kmcrane/Projects/HeatMethod/paperCACM.pdf When I run it I am getting a solution that, visually, seems correct: In this image, ...
Makogan's user avatar
  • 379
0 votes
1 answer
214 views

Incorporating heat flux into Laplace Equation

I need to find the temperature distribution of a square plate using the Laplace equation by using FDM: $$ \frac{d^2T}{dx^2} + \frac{d^2T}{dy^2} = 0$$ But there is a heat flux entering from the top ...
justauser's user avatar
  • 145
2 votes
2 answers
468 views

Two-dimensional heat equation with Neumann boundary conditions: any hope to find an analytical solution?

I am looking for references showing how to analytically solve the heat equation with Neumann boundary conditions in two dimensions. So far, I have found the problem solved analytically in one ...
Max_89's user avatar
  • 61
2 votes
2 answers
219 views

Heat equation in non-dimensional form behaving differently than in usual format

Starting from $$ c_p \frac{\partial u }{\partial t} = k \nabla^2 u $$ in a one dimensional domain [0,1] where $c_p$ and $k$ are modeling two different materials: $$ k = \begin{cases} 1 ~\text{if} ~x &...
balborian's user avatar
  • 601
2 votes
1 answer
303 views

Methods to improve the efficiency and the memory requirement of LU factorization for complex symmetric system matrix

I want to solve a linear set of equations (Ax=b) using LU decomposition. My "A" matrix is a complex matrix which is ...
HKK's user avatar
  • 33
1 vote
2 answers
812 views

How to use the Thomas-Algorithm to the Heat-diffusion-equation correctly

My post is structured in four parts: I give you some information about the context my principal questions refer to. I will tell you what I believe to know about the Thomas Algorithm. If I am wrong ...
tom terenius's user avatar
1 vote
1 answer
706 views

Effecient method for iterating over sparse dataset

Apologies if this isn't the appropriate forum for this question. I have a set of elements that I need to iterate over as part of a modeling workflow. The elements exists over a set of dimensions (i, ...
Sledge's user avatar
  • 119
2 votes
3 answers
553 views

Flux sign and face normal confusion in finite volume method

I implemented a solver for the 2D steady-state heat equation (without heat generation and homogeneous material) $\nabla. (k\nabla T) = 0$, using finite volume method, however, I am having some ...
Algo's user avatar
  • 304
0 votes
0 answers
69 views

How can I optimize that loop?

I need to populate a matrix $A_{kl}$, where $$ k = (m-1)J+n$$ $$ l = (p-1)J+q$$ And $$m,p = 1, 2, ..., I$$ $$n,q = 1, 2, ..., J$$ Its components are (mnpq). For ...
Ponyboy Curtis's user avatar
1 vote
0 answers
456 views

Incorporating radiation boundary condition at the edge in finite difference

I am trying to solve the 2-d heat equation on a rectangle using finite difference method. I am confused as to how to incorporate non linear radiation boundary condition at the edge. $-k\frac{\partial ...
Nitin's user avatar
  • 19
3 votes
0 answers
108 views

Correct approach for thermal finite element simulation of layered assembly

I would like to optimise the heat transfer on a PCB. Several dies are on the top and cooling air is going through the fins in heat sink on the bottom. The assembly consists of several layers like ...
Ken Grimes's user avatar
2 votes
1 answer
434 views

Solution method of nonlinear heat transfer analysis

The governing equation of transient heat transfer analysis is described as follows: $$C \frac{dT}{dt}+K T = Q$$ When using backward difference scheme for the discretization of the time we get the ...
vydesaster's user avatar
5 votes
1 answer
870 views

Fastest way to calculate the $2$-norm (or an upper bound for the $2$-norm) of the inverse of a matrix $A\in \mathbb{C}^{N\times N}$

I have a matrix $A\in \mathbb{C}^{N\times N}$ and I need to calculate $||A^{-1}||_{2}$ efficiently. Can it be done without having to evaluate the inverse explicitly? In general, I am looking for ...
sonicboom's user avatar
  • 153
0 votes
1 answer
51 views

Produce vertex displacements from volumetric shrinkage data on unstructured meshes

I was wondering what would be an efficient way to produce compatible displacements for mesh nodes/vertices if the computed data is volume shrinkage of each element/cell in the unstructured mesh? ...
Johntra Volta's user avatar
2 votes
1 answer
311 views

Lumped matrices in thermal analysis using finite elements

The governing equation of the transient heat transfer problem is $$C \frac{dT}{dt}+K T = Q$$ $C$ is the heat capacity matrix. $K$ is the thermal conductivity matrix. $T$ is the temperature vector. $...
vydesaster's user avatar
1 vote
2 answers
191 views

Simulating the heat equation with insulating material

My plan is to solve the heat equation in the right half portion of the domain, while having the left half completely isolated with constant temperature. To do so, I model the left half with a very low ...
balborian's user avatar
  • 601
0 votes
0 answers
88 views

Reducing run time of a numerical calculation using a mex file in Matlab

I wrote a Matlab code that involves doing a numeric calculation (relaxation), but it is quite slow. I learned of the possibility of using a mex file to run a C code and integrate it into Matlab, so I ...
TensoR's user avatar
  • 163
12 votes
2 answers
3k views

What is the most efficient way to write 'for' loops in Matlab?

I have read that if, for example, I have a double for loop that runs over the indexes of a matrix, then putting the column running index in the outer loop is more ...
TensoR's user avatar
  • 163