Science topic

# Finite Difference - Science topic

Explore the latest questions and answers in Finite Difference, and find Finite Difference experts.
Questions related to Finite Difference
Question
How can anyone measure reflection coefficient from the PML region, using FDTD, in a hollow (εr=1) rectangular wave guide, knowing only the fields for every time step inside the wave guide, while the fields inside PML are not extracted? Is there a straightforward way?
First, notice that there are two reflection effects involving in a PML layer: (a) the reflection produced at the exterior boundary where the PML layer is truncated (which can be controled with the PML absorbing profile) and (b) the reflection phenomena in the inner interface between the physical domain and the PML layer (this kind of reflections are due to the discretization and they are not present in the continuous model).
In your case, if you need to quantify both kind of reflections but you cannot evaluate the computed fields at the interior of the PML layer, eventually your best option could be based on computing two different problems with different physical computational sizes: the first one with a large physical computational domain (where the computed fields are used as reference solution close to the exact one) and the second problem with your actual physical domain and PML setup. Once, you are able to compare both computed fields in these two problems, the difference between them in the physical domain should be the reflection part of the field due to the presence of the PML layer.
Question
i want Finite Volume Method in easy way, which can easily solve the Elliptic and Parabolic Equations involving measure data, please suggest the relevant books or links which can solve it easily.
you can get help from the following link.
Question
The inhomogeneous heat equation is described as follows:
Ut - kUxx = f(x,t). In order to solve this inhomogeneous PDE, Are there any restrictions on the type of the function f(x,t)? Even / Odd or neither?
Thanks
Kulthoum
Dear Kulthoum Ismail,
Your PDE is linear and Non-homogeneous.The non- homogeneous function f(x,t) must  be  known real valued continuous function on given domain.It may be any function.There are so many methods for solving this equation under suitable initial and/ or boundary conditions.Some of them are:
I) Method of Separation (Oldest and simplest method)
II) Method of integral Transform
IV) Perturbation Method
But the non- homogeneous function f  is nonlinear  in U then we have to put certain conditions on f. It is different issue.
Best luck!!!
DNYAN
Question
Background: I am an ok coder but have not learned to use either of the above programs, both of which are freely available to me at my workplace and both of which I have been told will basically do the job with general numerical methods.
Extra background: The models I'm working with are black holes, so they are singular at at least one boundary (the event horizon), meaning that an adaptive step size method must be used; and given that there are essentially more free parameters to a general solution at infinity than at the event horizon, we sometimes need to use a "shooting" technique where we take 'initial' conditions at (near) both boundaries and try to match them up in the middle.
I can work out/look up the numerical recipes for the methods - but any advice on which programming language is more suitable would be greatly appreciated. Also, show your working ;)
C ++ is faster , but working with MATLAB is easier. If you have a very large data, that would be better to choose C , however if the data is not that big, MATLAB is better.
Question
Hi,
anyone knows anything about calculating shear stress near a wall in an orthogonal helical coordinate system? I want to calculate it using finite difference but I don't know how to start.
Question
Hello,
what does splitting finite difference scheme mean and how is it different from the regular finite difference methods??
Dear Abhishek, regular finite difference scheme computes derivative in Pn using values f(Pn-1), f(Pn), f(Pn+1) of a function f. Splitting scheme computes derivative in Pn using values on other neighbouring points Pn-m, Pn+m with m < n and m = n for a better approximation; so derivative f ' (Pn) value is "splitted" among contributions from a set of points in the computational grid. For an example of splitting method using Mathematica, see the following link.  Gianluca
Question
• Is there  any way to increase memory usage to generate 50x50x50 m of mesh size 0.1 m. first it does not run. and hang for hours and then it takes 12 hours for 1 step?
Question
Hello,
i am new at this area and want to simulate an one dimensional spherical transient cooling with convective boundary condition. I am using the finite difference explicit method.
My question is, how can i concert the time step from the finite difference explicit method to the fourier number / dimensionless number? My time step is delta_t = t_Max / (t_Nodes - 1)
The equation for Fourier number is Fo = alpha*t/L. Is the t every time step in my simulation? Where is the definition that my timestep has the unit seconds?
I need the dimensionless time to validate my results.
My conductive heat equation is:
rho * c * dT/dt = k * (d2T/dr2 + 2/r * dT/dr)
After approximation (explicit method):
rho * c * (T(n+1,m) - T(n,m)/delta_t = k * {[T(n,m-1) - 2T(n,m) + T(n,m+1)]/delta_r^2 + 2/[(m-1)*delta_r] * [T(n,m+1) - T(n,m-1)]/(2*delta_r)}
The equation for the temperature at next step is:
T(n+1,m) = (k*delta_t)/(rho*c*delta_r^2)*{T(n,m-1) - 2T(n,m) + T(n,m+1) + (T(n,m+1) - T(n,m-1))/(m-1)} + T(n,m)
One boundary condition on the sphere surface is:
rho*c*dT/dt = k*dT/dr + h*(T∞ - T(n,m))
-> T(n+1,m) = (delta_t)/(rho*c) * {k*(T(n,m+1) - T(n,m)/delta_r + h*(T∞ - T(n,m))} + T(n,m)
Am i on the right way to solve the problem with spherical cooling with transient heat transfer with convective boundary condition on one site?
Thx for help!
Dear Dominik
Regarding the time step units its definition its deeply embedden within the units of the different coeficients that you use inside the model such as K, h, rho, and c. To know the specific units of your model you have to perform a dimmensional analysis, however it depends specificaly on k and h, if those coefficients are expresed in a hour dependent unit your time step will be hours. You can also use a dimmenionless form of your model, you can find the proper derivation of dimentionless models in the following book.
I hope you find something useful inside my answer.
Question
d2y/dx2 =y2/(2+x) ; y(0)=1, y(2)=1.
for the above equation ,
1) how to apply the shooting method
2)  how to write the matlab code
3) how to get the numerical results
Hi, last point: to compute the value of the shooting function you simply have to call ode45 in order to numerically integrate the system of ODEs.
Question
Am I correct in saying that a hyper-finite frequentist account of probability would require not just absolute convergence of relative frequencies in the absolute limit but an absolute arithmetic convergence of the actual frequencies (so if the events are equally probable there must only be equal relative frequencies but precisely the same number of each event!;
So that necessarily on even odds, an agent will break precisely if the probability or relative frequencies are precisely 0.5; I say this because I would presume that even only tiny difference say finite difference between the number of A events in ~A events in an infinite collective would disturb the relative frequency if takes into account infinetismals.
It would make 0.5 + infinitesimal and if frequentist require necessary convergence to the probability values, and the probability values is precisely 0.5, then convergence has in some sense failed.
Would this strong kind of convergence have implications on place selection rules and the kinds of dependency that occur between events (events would appears to be more inter-connected, or teleological in a hyperfinite account as it cannot even account for the minutest of differences).
Likewise I presume the laws of large numbers (outside of frequentism would have to be different) ; i presume that even if one says that convergence only occurs with probability 1-infinismal, if infinitesimals infect the frequencies as well I presume that probability of gettting precisely that relative frequency is infinitesimal not 1- infinitesimal and so that infinesimals would have to placed around both the relative frequencies and probabilities values ie
Pr(lim>inf{ relative frequency of A in [Pr(A)-infinesimal, Pr(A) + infinesimal] }=1- infinitesimal; otherwise they would have to say that convernce is almost surely not going to occur, and if they do the above the difference between measure theoretical or more kolmogorovian nonstandard models and nonstandard frequentist models becomes much greater
Likewise could a nonstandard frequentist account for irrational probability values given that the sequences is treated in a finite fashion--- if its still considered countable infinite (whatever is that is analogous to in nonstandard analysis) I presume one could not fit all given real number relative frequency value into the collective as there are only countably many positions; 1.one cannot simply re-arrange as in the standard analysis case, so that becomes a different sequences, 2 perhaps treat two numbers very close together as the same number
Question
I am going to solve Richards equation for unsaturated zone using finite difference method. I read in several papers that van Genuchten method is used to estimate hydraulic properties. In van Genuchten formula we can estimate theta and K. what is the difference between the theta  obtained by van Genuchten formula and the theta  obtained by Richards equation. The other question is that in solving Richards equation we assume an initial h. in the next step h should be estimated so that we can calculate  using this equation. How it can be updated in each step.
I would recommend the method presented in the paper
Casulli, Vincenzo, and Paola Zanolli. "A nested Newton-type algorithm for finite volume methods solving Richards' equation in mixed form." SIAM Journal on Scientific Computing 32.4 (2010): 2255-2273.
Question
If there is any what is the difference or similarity ?
Speculating in mathematical terms, I think that is easier for a basketball game being played as music (because the 24 second clock play is equal to six musical "tempos") than a football game.
Here in Brazil when a football team like Messi's Barcelona plays, we say that "they play like music", but I can not see it further than a metaphorical term.
Best regards!
Question
Hello,
Anyone could explain the physical meaning of the partial differential equation coefficients in the propagation of elastic waves in solid media?
Equations for isotropic solid media in 2D:
Equation 1: ρ (∂ ^ 2 u_x) / (∂t ^ 2) = (2G + λ) (∂ ^ 2 u_x) / (∂x ^ 2) + G (∂ ^ 2 u_x) / (∂y ^ 2) + (G + λ) (∂ ^ 2 u_y) / ∂x∂y
Equation 2: ρ (∂ ^ 2 u_y) / (∂t ^ 2) = G (∂ ^ 2 u_y) / (∂x ^ 2) + (2G + λ) (∂ ^ 2 u_y) / (∂y ^ 2) + (G + λ) (∂ ^ 2 u_x) / ∂x∂y
Recalling that I understand what the physical parameters (G; λ) themselves represent for the specific physical problem, but I do not know what is the physical implication of its use as a multiplier of each partial derivative.
Thanks in advance for the help.
Renato
Dear Martin Baeker, I really appreciate your help! Your explanation is very clear, but I believe there is something I couldn't get it.
Taking your analogy of the spring as a reference, then you have:
mass * acceleration = force (Newton's second law),
but force = stiffness * displacement
In the elastic wave equations you have:
density (kind of mass) * acceleration = stiffness_type1 * (second order derivative of displacement in the space domain) + other derivatives...
The rhs of the elastic wave equation shouldn't result in a kind of force or stress? Additionally the rhs is formed of 3 parts, including the cross-derivative, which I believe should have, as a multiplier, a kind of combined stiffness.
If what I said is correct, could you give me a tip on how should I think to get the force or stress in the rhs of the equation?
Thanks a lot for your kind attention!
Question
How do you implement a higher order finite difference schemes, like 5th or 7th order scheme, or a 6th order central scheme near boundaries? As in, near boundaries you don't have enough points to implement such schemes. What do you do in such cases?
Note that the boundary conditions are not periodic. There will be inflow, outflow and wall boundary conditions.
Use compact finite difference schemes, see the work by Lele.
Question
Since the nonlinear term can be discretized nonlocally in several ways, what properties do you need to look at to make the best choice?
Look at this doc it may be helpful for your topic .Good luck.
Question
I consulted several works but could not get any suitable reasoning for the reason of reattachment of the bubble downstream of the flow except the fact that the separated bubble reattaches in the fluid at a point, known as Saddle point. I am in search of physics of reattachment.
Hello Kumar,
In the presence of laminar-turbulent transition, flow may reattach (e.g. on wings of gliders) as follows: Initially laminar boundary flow may separate because of an adverse pressure gradient. Now the flow becomes strongly unstable and hence turbulent. Hence, it reattaches further downstream because of the stronger resistance of turbulent boundary-layer flow against separation.
Best regards, Johannes
Question
I am trying to discretize steady Navier Stokes equations for flat plate boundary layer. But I am facing problems in convergence of the iterative solution.
Question
I realize compact finite difference schemes and lattice Boltzmann methods are popular techniques for CAA.
On the other hand, there are very few articles on CAA using finite volume techniques.
Are there particular reasons why CAA using finite volume techniques are not popular?
Question
I am performing frequency calculations for an adsorbate on a small surface with tested parameter setups. But the calculation always stops without error notices. The last message was "Harmonic frequencies will be computed by finite diferences", "Number of displacement per atom is: 2", "Step size for finite difference is： 0.01 Bohrs".
It seems the caclulation stops for no reason.
My system is composed of 40 atoms, not a large system.
I will be very appreciated if you can help.
All the best
Haiping
No, not vasp code dmol3 code. A laco-basis DFT code.
Question
how the equation formula propagation of microwave heating on the material, using the method of finite different time domain? thank you..
If I understand correctly, you want to simulate microwaves being absorbed in a material and also simulate the transient heat in that same material?  If I am correct in what you want to do, this is called a multi-physics simulation.  There are a number of commercial software packages that can do this including Ansys HFSS, CST Microwave Studio, COMSOL, and others.  COMSOL is best known for multiphysics, but other packages can certainly do it.
If you are more interested in developing your own code, I would consider developing a frequency-domain code for the electromagnetic simulation and combine that with a time-domain heat equation simulation.  The thermal response will be so slow enough compared to the electromagnetic waves that I think this is your best approach.
If you want to learn FDTD quickly, I teach a course on the method.  Here is a link to the course website:
If fact, I will be teaching this course again in a few weeks so I am sure I will make some revisions, corrections, and other improvements.  To get a feel for coding FDTD, there is a series of six MATLAB Computer sessions where you watch me type every single line of code as I explain what I am doing and run the code at various stages of development.  The six sessions eventually build a fully functional and rather sophisticated code.  To fully understand the code, also watch the videos through Lecture 10.
If you get through all of this, I think it will be more clear to you how to solve your problem.  If you want to see a frequency-domain version of FDTD, take a look at Lectures 11, 13-15 here:
Hope this helps!
Question
please I want some references about the finite difference schemes for the convective terms in the navier stokes equation .
thanks my friends .
You can see this book., Very helpful in such problems.
Question
I am interested in determining sump depth for DCC of cylindrical billets when the solidus and liquidus temperatures of the aluminum alloy are known.
So I want to plot temperature v/s cast length(z) along the center line(r=0) i.e. solving heat conduction in cylindrical coordinates
Can I use MATLAB for this?
You can
Question
The problem i'm working on is a boundary layer problem where the resultant equation is a coupled partial differential equation.The equations are linearised and finite difference has been substituted which ends up as a system of equation which can be written as AX=B.where A is a block tridiagonal matrix.
Well, block tridiagonal systems arise in many contexts. The solution of Poisson's equation in 2D using finite differences could be encoded that way, although the great majority of people will use iteration, such as S.O.R. or even multigrid. I started solving block tridiagonal systems as a PhD student, and wrote the code in Fortran - I still use that code now, although it has become very considerably more well-written since! It would have been embarrassing to have left it as it was!
I admit, however, that I am not a Matlab user, but people have told me that it works best when one uses matrix manipulations. When one tries to "micro" encode (i.e. using detailed manipulations involving elements of a matrix rather than the whole matrix), then it becomes very slow. Perhaps matlab users could advise about this aspect.
Essentially the block tridiagonal matrix algorithm is identical to that version of Gaussian Elimination that one uses for a simple tridiagonal matrix. The only difference is that, when one divides by a scalar for the TDMA, then its equivalent for the BTDMA is a multiplication by an inverse of a matrix. It may then be possible to organise your Matlab code in an efficient way which extracts blocks from the block tridiagonal matrix and places then into smaller matrices which are then multiplied or inverted as necessary.
I hope that the previous paragraph isn't unclear, but as it is tricky to describe these concepts using only words, I have attached some old teaching notes from 1994. Hopefully these will be of use to you.
Best wishes, Andrew
Question
It's known that we can approximate a solution of parabolic equations by replacing the equations with a finite difference equation. Namely, we can solve parabolic equations by Difference Equation Replacement or Crank-Nicolson methods. I need Matlab code of Crank-Nicolson method for attached problem
Dear Elvin,
Please, find attached several papers describing Crank-Nicholson scheme accompanied with its Matlab code, and also these http links:
Question
Is there any alternative explicit method instead?
Dear all Do you know if there's any alternative explicit methods for the treatement of the material nonlinearity, instead of the incremental iterative classical methods? The children in the class shall have to know
Sincerly..
Yes, 42.
Question
Classical numerical methods (Finite difference, Finite volume, Finite Element,... rely on a mesh to solve the problem. The Finite Element Method (FEM)and Finite Volume Method (FVM) may be the most well-known members of these thoroughly developed mesh-based methods. In contrast, a comparably new class of numerical methods has been developed which approximates partial differential equations only based on a set of nodes without mesh.
Absolutely.
To be considered also accuracy, CPU time, hardware and effort.
Question
Hi,
The stability condition for 1-D heat transfer equation is a*delta_t/delta_x^2 <0.5 in finite difference method.
Is it also valid if i use explicit finite element method?
Thanks
Even among finite difference methods there are different stability criteria. The one you quote is an approximation to that for the use of Euler's method for timestepping when using second order central central differences in space. Backward Euler and Crank Nicholson are unconditionally stable. One may use a fourth order Runge-Kutta scheme for the timestepping and this will be different again.
Question
I have the following problem:
u_t = u_xx + u_yy, in Omega, t > 0
u(x,y,0) = 1, in Omega
u(x,y,t) = 0, on dOmega, t > 0
when Omega is defined to be a domain between the rectangular 1x1 and the circle of radius 0.3 centered at (0.5,0.5). dOmega denotes the boundary of the domain Omega.
I want to solve the problem numerically using explicit scheme for dx = dy = 1/50. And I want to solve it in MATLAB.
So far i got a general scheme for all the points, the problematic and non-problematic ones. But I don't know how to compute it.
I want some code that can, for each point, detect the value of alpha and beta (the coefficients in front of dx, dy when the distance to a neighboring grid point is less than dx or dy, i.e. when the neighboring grid point is on the boundary of the circle), for every point on the grid.
Can anyone help me figure out how to compute this?
Hello Jonathan Emil Gundorph Jansen
This problem can be solved by the usual method by discretizing the PDE into FD equations in the usual way. If a uniform grid is created in a zone with rectangular boundaries then the solution will be elementary. However, for your problem, even if you create a uniform grid, near the boundary circle the grid will turn out to be quite non-uniform and special finite difference equations need to be written for such points. That is the reason the FEM is preferred to the FDM. The former can handle non-uniform grid quite easily.
Question
Any material or suggestion about the above said problem?
Dear Nauman,
This depends on what kind of stability you look for. One possibility is to prove that the solution remains bounded almost everywhere (stability in the L^\infty), like a maximum principle or that it satisfies a bounded growth in time. For example, often the solution remains positive. If this is a property of the solution of the non-discretised problem, than the same could hold for the discretised one. However, the discretisation should be as such (e.g. Euler implicit in time, and the finite difference discretisation should lead to M-matrices).
In the same spirit, you may prove some monotonic behaviour of the solution. In other words, that two solutions satisfying the same equation, but with ordered boundary and initial conditions, remain bounded as well.
Alternatively, you may try energy methods. For example, you may show that the L^2, H^1, or similar norm (in space) is decreasing in time, or its growth is bounded. This would be, however, valid for many discretisation schemes and should actually hold for the non-discretised problem.
Good luck,
Sorin
Question
In the finite element program known to me, the failure criterion is defined in the p'-q diagram. Is there a program that defines the break criterion in Sigma 1, Sigma 2, Sigma 3 space? The problem is that with overconsolidated clays the horizontal in situ stresses are overestimated, if the soil model is only defined by p'-q space.
Question
Can anyone help me for Matlab codes for CFD, CRN , CRP which are various methods for sensitivity analysis?
Question
Hello , I am new to numerical methods and I have come across 2 system of non linear PDE that describes flow through a fractured porous media. I have used finite difference to discretize the sets of equation but I cannot really go on from there. FDM is the only method I know but would appreciate other ways of solving it if its something I can follow. Can anyone help me find the best way to solve these equations ? please find attached system of equations.
Dear John,
At a quick glance, what you are writing looks fine. The chief problem with using a backward difference in time with a nonlinear problem is that it results in a set of coupled nonlinear equations for the unknowns. Generally this can be solved using an iteration scheme (ad hoc, or multi-dimensional Newton-Raphson, or even Keller-box). This will require some extensive coding. If you were to adopt a forward difference timestepping scheme, then you wouldn't need to iterate at each timestep.
Both types of timestepping have advantages and disadvantages. For forward differences (i.e. Euler) the advantage is rapid encoding and rapid computation per timestep while the disadvantage is the potential need to have quite small time steps in order to maintain numerical stability. For backward differences (e.g. backward Euler) the advantage is that relatively large timesteps can be used (assuming iterative convergence, which isn't guaranteed), while the disadvantages are a much longer code development time, and much more CPU time per time step.
Personally, I would always attempt the explicit scheme first to see roughly how the code behaves and how the physics of the problem behaves. Only then will I proceed to an implicit scheme, and only if it turns out to be necessary to do so.
Regards,
Andrew
Question
The wave equation in one space dimension can be written as follows:
∂2u/∂t2 =a ∂2u/∂x2+ b ∂2u/∂y2
This equation is typically described as having only one or two space dimension "x", and "y" because the only other independent variable is the time "t". The question is what is the stability criteria when using the explicit finite difference method?
Question
I need to solve the Fokker-Planck equation numerically. I need to know which method is the best method for solving this kind of PDE? among Finite difference, Finite element, Finite volume, Spectral methods, or any other kinds of methods?which ones is the best choice? and by the "best Method" I mean stable and fast numerical method.
This
is a very classical approach, whereas this
is a more recent proposal. Be careful, since the Fokker Planck equation is not hyperbolic, it would rather fall in the cathegory of 'advection-diffusion' equations, since it contains both first and second order terms in space.
Question
COMSOL v5.1 has possibility to use an Adaptive method to define Curvilinear coordinates system. According to description of the method, the adaptive method adapts the computed vector field to maintain a constant streamline density on the cross section.
1) What is mathematical or physical background of the Adaptive method?
2) What are system of equations and boundary conditions used to compute vector field in Adaptive method?
Algis
Question
Dear all,
I want to know that what is the reason of the usage of FEM in fluid mechanics. Isn't FVM better than FEM?
Why some softwares like COMSOL sill use FEM?
Is FEM has any advantages over FVM?
Which is better?
Regards,
Often the simple answer is that depends on the "tradition" of the code.
Then, "better" is too general. We should focus on accuracy and computational cost and hence on the resulting efficiency. FEM is somehow less efficient than FVM for higly non-linear flows but recently DG method received new attention in the CFD community.
Finally, I would stress that FVM is nothing else that a FEM for a specific choice of the test-function.
Question
Some times tetrahedral mesh is better and some times hexahedral mesh elements are approximate the material in better way. I want to know the conditions. Advantages and disadvantages of these type of solid 3D elements.
Tetrahedral elements can fit better complex geometry. However, when you integrate the shape functions with points of Gauss it is less accurate than hexahedral elements. In addition, one of the factors that determines the quality of your mesh is the distortion of your elements. The reason for this lays on the mapping from real to natural space of integration. To sum up, if your geometry is simple, the best option is to mesh it with hexahedral elements. If it is not possible (curved geometries, accute angles or similar) then go with tetrahedal but controlling the distortion of the elements.
Question
finite element or finite difference
Finite volumes ! :)
It really depends on the problem (fluid, structure, electromagnetism, interfaces or not...) the geometry, and the nature of the PDE system
Kind regards,
Question
Hi, I have a question the possibility of importing results from a FDTD simulation (3D) into COMSOL and solve a combined heat transfer/fluid dynamics problem. I want to compare the results I get through a complicated Finite difference volume technique with (I presume), faster to obtain, results from COMSOL
Thanks a lot for the recommendation. I will try . Best. George
Question
I need to solve the cable equation unidimensional using finite differences.
Question
The solution of Schrodinger equations in cylindrical coordinates are written in the form of Bessel functions, by applying the boundary conditions, one has to deal with (Adding, Dividing or Multiplying) for Bessel functions in order to get the allowed energy values
You are welcome Ahmed.
On the subject of Bessel functions, their associated addition theorems, etc., you may wish to consult the following section of the Digital Library of Mathematical Functions, at NIST: http://dlmf.nist.gov/10
Question
Hello,
I am currently working on the k.p method, and more specifically the application of this method, for the calculation of electronic bands in quantum well structure.
I would like to use finite difference method for my calculation on matlab software, unfortunately I am a newbie in this technique. I think I can generate the code to create the discretized hamiltonian but I don't know how to resolve it and treat the eigenvalues.
Does anyone have a detail algorithm, or some article related to the problem ?
Hi Romain de Oliveira , did you have any luck with this? I am now in the same position where I am trying to write a matlab code using the finite differences method to solve the light and heavy hole energies of the valance band of a semiconductor Quantum Well.
Do you have any advice you could share?
Question
What type of code are you using? Is it Finite difference or Finite element method? Is that a Matlab code related to Gerya 2010?
I don't do modeling.  Geodynamist can answer your question.  One way to model this is to assume earth is consisted of layers with different viscosity.  If you hydrate the lithosphere throughout subduction processe, then the bottom part of the lithosphere will become less viscous and boundary layer instability will develop.  Small scale convection can gradually remove the lithosphere.
Another way is to thicken the crust (60-80 km) then the base of the magic crust will change phase into eclogite.  The higher density will start a gravitational instability and remove a large piece of lithosphere. Some data in the Andes seems suggest such process can occur, but Not in the Himalyas nor Tibet.
Question
when we calculate the scattered field with PML and non- PML  boundary condition for chiral media
Question
I am trying simulate an infinite domain so I need to use non-reflective boundary conditions. While searching, I came across PML method, but I have certain doubts.
1) How to decide the dimensions of the PML layer?
2) What effect does PML mesh size have on the reflected waves?
I am using TNO DIANA and I simulated a block of soil of 50 m subjected to an impulse load and tried to see the wave travel. I used PML lengths of 10 to 50 m . However, I can still see waves reflecting back. I also tried to increase the function values assigned at the PML boundaries, but after one point I see that the PML behaves like a clamped or fixed boundary. Can someone point me to a source where PML is explained clearly?
Thank you very much.
It is not sure which software you will use.Generally, PML requires approximately a thickness of one lamda (largest wavelength). In COMSOL,the PML is available for frequency domain simulation.However, it does not provide PML for transient simulation based on the elastic wave equations.You can refer to my published work.
Question
Hi
I am coding a D2Q9 incompressible flow, and i wanted to try MRT.
After some reading, i saw i need to choose some parameters.
How should i Find those parameters?
I think you could read this paper: Theory of the Lattice Boltzmann Method: Dispersion, Dissipation, Isotropy, Galilean Invariance and Stability
Question
Hello beautiful minds
I have to analyse a simple microwave structure using the Boundary Integral-Resonant Mode Expansion (BI-RME) where I have to calculate the coefficients Aij, Bij, Cij and Kp in order to calculate the admittance matrix. Well, for Aij and Bij it's a simple formula, however, for Cij and Kp I should solve Helmholtz's equation in a 2D domain (Laplacian (U (x, y)) + Kp ^ 2 U (x, y) = 0), so after several attempts, I can find neither Cij nor Kp. I was wondering if someone might be able to give me a help by answering my questions below:
1- the analytical formula of eigenfunction U(x,y) depends on two natural    constants (m,n)?
2- How many eigenvalues I should take in consideration to get best results?
I'll appreciate if you add some detail exemplification.
Hello Sudipta Maity, thank you for answering my question
in the first step I use a rectangular waveguide just to test my Matlab code, in the second step I would like use it for analyse a substrat integrated waveguide.
Question
So far, I have tried RK method of order 4 and looking for something better.
Question
For example: While solving a 3-phase fluid flow equation, can we use the finite difference for the mathematical model and finite volume for the physical model.
I did not get you. As fast as I know, the procedure is to have a mathematical model to describe a physical process (or model in vague terms). And then one chooses appropriate numerical scheme to solve the mathematical model which is often a form of the differential equation. FDM, FEM, FVM are then picked based on the needs of the problem and one's own choice of expertise!
Question
I am solving a parabolic PDE with compact finite difference schemes and I don't have the exact solution for that. So how can I obtain the spatial order of convergence and temporal order of convergence separately for the above PDE because double mesh principle gives the global order of convergence (to the best of my knowledge).
As others have suggested, if the accuracy of your scheme in time is known, then you can adjust the time step so that the error of the time scheme will be smaller than that of the spatial scheme - for example, if you have a 2nd order scheme in time but a 4th order scheme in space, then the time step should be at least as small as dt = O(dx^2) - this way, the error of the time scheme is O(dt^2) = O(dx^4), and the resulting global convergence rate will allow you to determine the spatial accuracy up to O(dx^4).
Your question about not having an exact solution to compare with has not yet been addressed. The general idea is to compare your numerically obtained solutions on successively finer grids. The simplest case one can imagine is a finite difference problem with equally spaced Cartesian nodes. In this case, say you use a grid with 16 nodes in each spatial direction for your first computation and a grid with 32 nodes in each spatial direction for the second. You will need to be careful that the 32-node grid coincides with the 16-node grid at those 16 nodes, and then you can compute the error between the two numerical solutions at those 16 nodes. In order to get a convergence rate, you will have to take one more refinement - now do the same with 64 nodes in each spatial direction (which again coincides with the previous grids), and compare the numerical solutions on the 32-node grid. From the ratio of the 16-32 error and the 32-64 error, you can get a measure of the convergence - you will probably want to continue this process for another step or two.
It is also critical that the times that you are comparing at coincide - you may either choose some final time to end all simulations regardless of the space/time steps, or else you may do something similar to the above spatial grid in time and compare the solutions at several different time steps on successive grids, making sure that your time grids coincide as you refine.
Question
U_x + u_xxx = 0
Dear Cosmo, the third derivative with second order accuracy is
[-1/2 f(x-2) + f(x-1) - f(x+1) + 1/2 f(x+2)] h-3
where e.g. x-2 = x - 2h.  Gianluca
Question
the doubt is " how to apply the boundary condition in timenshenko beam using finte difference  technique "?
If any  one able to send the sample code for timoshenko beam , to my mail id
Bewteen boundary ponit x_n and internal node x_{n-1}, add a midpoint x_{n+1/2}, and then, apply Taylor formulate, etc,  to the midpoint. Thus you can obtain a difference scheme.
Question
I have programmed 2D magnetotelluric forward modeling using both finite difference and finite element method . i want efficiency analysis of these pregame. What is the best way to do this ?
.First of all modify your programs ( or take data from some published work) for the analytical solution and compare Analytical, FDM and FEM solutions.
. Using that analytical solution, compute RMS error or Maximum error for different degrees of freedom( no. of nodes in the domain) and plot a comparative study on a log log scale.
.Additionally you can show CPU time comparison.
Hope this helps.
Regards,
Pankaj
Question
I am trying to write a finite difference code in Matlab to solve the Kirchhoff's plate equation. So far, I have been able to generate the biharmonic/bilaplacian operator matrix. However, I am struggling with how to impose the boundary condition. I would be glad is someone can help explain how to achieve this.
I have taken the liberty of attaching here an m.file I found on the net prepared by
I. Danaila, P. Joly, S. M. Kaber & M. Postel. The task is to use this to generate the biharmonic operator matrix of the kirchhoff's plate equation (which I also have taken the liberty to attach here as well). Thanks
Dear Yakubu.
my grasp of your problem is smattering.I hope you'll explain this matter  a bit more!
You may use fictitious point method, by defining an point of variable matrix and via discritizing conservation   equation in boundary and use this nes equation for evaluating you fictitious point.
if this is near to your problem , you may find classified methods in GERALD advaned mathematic book
regards
Question
I read recently that "it is not possible to get second order accuracy at the boundaries using finite difference method, were as same is possible with finite volume method. Which by the way is one of the differences between finite difference and finite volume method." Can anyone give me a better insight into this?
Thanks!
You can get any order you wish.
Question
Can we approximate the solution to a singular IVP on a domain that extends past a known singularity?
As an example, consider the problem
y' = y^2,  y(0) = c > 1,
on the interval [0,1]. The solution is given by
y(x) = c / (1 - cx), x in [0,1] and x =/= 1/c,
and has a singularity at 1/c. Is there a finite method that approximates the solution on [0,1] and handles the singularity in a reasonable way?
Any numerical method that is based on Taylor expansion such as Euler and Runge Kutta solvers can not handle your problem since all these methods are derived under the assumption the solution is smooth and of course bounded in the interval.
But  there exists some methods based on pade approximations, rational approximation of the solution. These kinds of methods can represent the singularity and go beyond the singularity. I recommend the paper " A numerical methodology for the painleve equation, journal of computational physics, 2011"  by Fornberg and Weideman
Question
Caution: complete ignorance on display in 3...2...1..
I know that econometrics doesn't use "fixed effect" and "random effect" in the way that biostatistics does.  I've got the dim idea that both are actually "random effects" in the sense that I would use them, except the econometrics "fixed effect" is correlated with the predictors, and the approach to solving involves taking finite differences.   However, I'm trying to find a more concrete description, preferably from someone out there who may have worked with both.
This is primarily driven by my own desire to understand these tools better than I do, but I'm also aware there may be a reason to poach -- er, adapt -- tools from other disciplines. I'm also concerned that one day I may be talking to an economist or social scientist and, as someone once said about the US and the UK, we'd find ourselves separated by a common tongue.
Thanks!
I gave an extended answer about being separated by a common tongue on CrossValidates StackExchange website, see the link.
Both econometricians and biostatisticians work with the model
y_ij = x_ij' beta + u_i + e_ij
Typically, in biostatistics, i enumerates individuals, and j, visits/measurements, and in this case the data are called longitudinal. In econometrics, i again may enumerate individuals, and j denotes time (often balanced, e.g., every year); economists call these data panel. Other applications economists work with include countries or states as i, and years as j.
There are several estimators for this model. Of course, OLS provides the benchmark:
beta_OLS = (X'X)^{-1} X'Y, unbiased when E(x_ij u_i)=0, E(x_ij e_ij)=0.
You can construct a between estimator by averaging the system over the faster changing subscript j:
bar y_i = bar x_i' beta + u_i + bar e_ij ~ bar x_i' beta + u_i
beta_between = (bar X' bar X)^{-1} bar X' bar Y
which is unbiased when E( bar x' u) = 0
You can construct the within estimator by forming the deviations from the mean:
y_ij - bar y_i = (x_ij - bar x_i) beta  + e_ij - bar e_i
and construct the GLS estimator on the thus transformed model. The GLS is fully feasible since you know the covariance structure within the individual: Cov[ e_ij - bar e_i, e_ik - bar e_i] = -1/n_i sigma^2_e, and sigma^2_e can be factored in front of the fixed covariance structure matrix.
Finally, the biostatisticians' default approach is the GLS on the whole equations: assigning sigma^2_u and sigma^2_e as variances of the two term, and assuming that u and e are independent of each other and of everything else, you can form a block diagonal covariance matrix of the full residual v_ij = u_i + e_ij, and if Omega = Cov[ v ] across the whole data set, then
hat beta GLS = (X' Omega^{-1} X)^{-1} X' Omega{-1} Y
which is the efficient estimator under this model.
As far as I understand, biostatisticians typically a rather limited set of variables as x_ij's that may include age, gender, and some other stuff. Economists don't have problems with age and gender, but they may have problems with say education: if your dependent variable is income, then an individual may have taken an intentional decision to reduce their income early in the life and go to college in order to increase their income later in their life. Thus education and income are not unrelated. When that happens, E( hat beta_OLS ) = (X'X)^{-1} X'( X beta + U + E) = beta + (X'X)^{-1} E(X'U) != beta. Likewise, the GLS and the between estimators are biased. However, since u drops out from the within estimator, it remains robust to the violation of the assumption of independence of U and X.
Now, if you rename the within estimator and call it "fixed effects", and rename the GLS estimator and call it "random effects"... well, you just had your Panel Data Econometrics 101.
One of the additional contributions of econometric thinking here is the Hausman test to see whether the beta_GLS/RE and beta_within/FE are more than just the sampling variance away from one another. If they are, we immediately suspect that E(X'U)=0 assumption is violated, and everything except the within estimator is biased.
I would recommend Jeffrey Wooldridge's Econometric Analysis of Cross-Sectional and Panel Data (2nd edition, 2009 or 2010). I think he does start by saying that the model is the same, it's just two different estimators that you apply to it. (Economists have been involved in some deep thought philosophical discussions of fixed effects estimator only applicable when you have a small number of clearly defined, unique units, like the U.S. states, while the random effects estimator is only applicable when you have a random sample of individuals, such as in country-wide samples, but I think this is a superficial debate.)
Question
It is accepted that given a 2nd order linear or nonlinear ODE au'' + bu'  + cu where a, b,c can be functions of x,u,u' with the prime denoting derivative wrt x  and that if initial values are prescribed then the solution can be obtained using Runge-Kutta methods etc while if boundary values are prescribed then the ODE could be solved using the Finite Element or Finite difference Method. My question is why can't an Initial value Problem (IVP) be solvable using the Finite Element method?
My question is limited to ODE's and PDE's are excluded. Basically I am asking why can't an IVP involving an ODE of 2nd order and above be solvable by FEM. Note that the heat-type PDE  ut = c*uxx  can be solved via FEM because the problem is of 1st order wrt time derivative and 2nd order wrt spatial derivative. This PDE usually presents an IVP in time but a BVP with x.
There are several different Finite Element Methods, not just one. ALL of these methods can be classified in 2 groups: (1) F.E. methods based on fundamental Lemma of Calculus of Variations (Galerkin method, Petrov-Galerkin, Weighted residual, Galerkin method with weak form) and (2) F.E. method based on a residual functional associated with the differential equation (least-squares method).
There are several types of differential equations. Hyberbolic, Elliptic, Parabolic, First order, Second order, etc. HOWEVER, ALL differential equations have a differential operator associated with them and ALL differential operators can be classified in 3 groups: (1) self-adjoint (2) non-self adjoint (3) non-linear.
For a F.E. method to be used successfully for a specific differential equation, the resulting coefficient matrix in [K]{u}={F} must be positive-definite (This means that [K] can be inverted and the obtained solution {u} will be unique).
The following 3 statements are not opinions but Theorems with proofs:
- When the differential operator is self-adjoint: Galerkin method with weak form and least squares process are the only F.E. methods that guarantee positive-definite coefficient matrix [K].
- When the differential operator is non-self adjoint or non-linear: least square process is the only F.E. method that guarantees a positive-definite coefficient matrix [K].
- When considering an IVP, the differential operator is either non-self adjoint or nonlinear. It is never self-adjoint. Hence, the only F.E. method that can guarantee positive definite coefficient matrices for all IVPs is least squares process.
There is a lot of research done to make the Galerkin method with weak form produce coefficient matrices that are positive-definite. These are known as stabilizing techniques. However, all of these techniques, without exception, end up changing the original IVP.
Many people are under the impression that Galerkin method with weak form is the only F.E. method. This is because ALL commercial F.E. softwares are based on this method. The reason for this being that the differential operators of differential equations describing elastic solid mechanics are always self-adjoint, hence Galerkin method with weak form works great! Least-squares process also works great, however, Least-squares process requires additional resources (in terms of interpolation theory) that didn't exist at the time when commercial F.E. softwares started to appear (1960s). Hence, people didn't consider Least-squares process. Around the late 1990s, those additional resources needed for least-squares were invented, and least-squares started being used in the research area. However, since so many companies were built on Galerkin  method with weak form and they are only marketed towards solid mechanics applications, they still continue to use it.
Other methods to solve differential equations such as: Finite Volume, Finite Difference, Runge-Kutta etc suffer from the same disease than Galerkin method with weak form. Meaning, that they do not guarantee positive-definite coefficient matrices. This does not mean that unique solutions are not possible using these methods, but it means that you will only know it after the [K]{u}={F} is obtained and if [K] is not positive definite, then stabilizing techniques must be used. Runge-Kutta method and Finite Difference methods are very easy and fast to implement. Hence they popularity. However,  when considering complex problems where you might end up having a [K] matrix that is a million-by-million, then they might or might not work and if they don't work, stabilizing techniques might or might not give you the right solution.
So to answer your question, F.E. method can be used to solve IVP. Either using Galerkin method with weak form combined with stabilizing techniques (see works of T. Hughes) or using least-squares process. If you are interested on using F.E. method to solve ODEs in time, then you should real this article:
- K. S. Surana, L. Euler, J. N. Reddy, A. Romkes: Methods of Approximation in hpk Framework for ODEs in Time Resulting from Decoupling of Space and Time in IVPs. American J. Computational Mathematics 1(2): 83-103 (2011)
This article explains into details how to handle IVPs by decoupling space and time and as a result, obtaining a system of ODEs in time. Then it compares F.E. methods and other methods such as Newmark, Wilson method. I hope that gives you a better idea of the subject.
Question
FEM or finite difference ?  Thanks all, Si
Do you mean the Navier-Stokes equation?
Question
I have doubt in Analysis the mode shape and natural frequency of timoshenko beam in matlab using finite difference technique
clear all;close all;clc;
% FD T-beam program for nonuniform,cross section of beams.
a=0; %initial position of fish in "x axis "
b=1; % final position of fish in "x axis "
N=60; % number of cycle
M=4; %for the first 12 value
alpha=0.25; % CONSTANT
R=4500; % R = Slenderness ratio
E=200e9;
I=0.0001171;
A=0.0097389;
p=76.5e3; %desnsity
%2. main calcultion
x=linspace(a,b,N);
h=x(2)-x(1);
hs=h*h;
ht=2*h;
I1=eye(N,N);
I1(1,1)=0;
I1(N,N)=0;
for j=2:N-1
D1(j,j-1)=-1;
D1(j,j+1)=1;
D2(j,j-1)=1;
D2(j,j)=-2;
D2(j,j+1)=1;
end
By1=[1,zeros(1,N-1)];
Bf1=[1,zeros(1,N-1)];
ByN=[zeros(1,N-4),-1,4,-5,2];
BfN=[zeros(1,N-4),-1,4,-5,2];
ma=[alpha*D2,alpha*D1;...
alpha*R*D1,D2-alpha*R*I1];
[Vv,Ev]= eig(ma);
for m=1:6
k=0;
for j=1:2:N
jj=j+N;
k=k+1;
Wv(k,m)=Vv(j,m);
Uv(k,m)=Vv(jj,m);
y(k)=x(j);
end
end
plot(y,Wv(:,2),y,Uv(:,2),'*')
%xlabel('Modes 2 Y=solid, F=dashed','x','Y (amplitude) and F (shear)')
%xgrid
Fully agree with Amaechi J. Anyaegbunam,
there many books with explicitly written FEM matrices for Timoshenko beam eg. Finite Element Procedures: K.J. Bathe etc etc It is more efficent to use FEM rather than FD - you will not have problems with Boundary conditions (like difficulties within FD method)
Question
I have doubt in Analysis the mode shape and natural frequency of timoshenko beam in matlab using finite difference technique ,
the doubt is " how to apply the boundary condition in timenshenko beam using finte difference technique "?
If any one able to send the sample code for timoshenko beam , to my mail id
Question
Hello, I am writing a code to resolve an advection problem in 2D, I am using finite elements with a mesh in which there are many triangles. And all my nodes are numbered so I which to know if there is some one who can help me by providing me some ideas/articles where i can find a solution for the calcul of my nodes gradients in x diection and y direction. For example for rectangular mesh, expression of gradients are like this u_x(i) = (u(i+1)-u(i-1))/2dx . Thank you for any information that could help.
If you are using classical finite elements on triangles, then the gradient will be discontinuous along edges. You may first define the ''trianglegradient''  for the inner of each triangle using the appropriate interpolation scheme and evaluating the gradient of the interpolating polynomial  in the center of gravity of the triangle, e.g. for piecewise linear elements by piecewise linear interpolation. for the nodes you may use the arithmetic mean of the triangle gradients for all triangles to which the node belongs.
Question
who can provide a code for the 2D space fractioanl equation by the finite difference schemes?
Question
Which dimensionless numbers should be taken into account in the stability analysis of a numerical method for Unsteady Convection-Diffusion Problems?
These the following three parameters
Courant number: The Courant number is deﬁned as Cr =epsilon Dt/h
Diffusion number: The diffusion number is deﬁned as S = gama Dt/(h*h)
Grid Péclet number: The Péclet number is deﬁned as Pe =( epsilon/ gama ). h
Question
I'm trying to develop a 3D Cylindrical FDTD code with CPML boundary conditions regarding a simulation of a waveguide. So, CPML will be located at the far end of the waveguide along the z-axis (propagation axis). The Z coordinate should be stretched also and pml conductivity should be scaled according to a numeric profile. Usual FDTD equations include the term (2epsilon-sigma*dt)/(2epsilon+sigma*dt) regarding conductivity inside the medium. But CPML equations also use the term conductivity to describe the scaled quantity used in them. With only z stretching, only rho and phi components' PML equations use the scaled conductivity (in this case z-component of coductivity via the convolution terms). The question is, should I use the z-component of the scaled conductivity in the update equations of Ez component, or it should be used ONLY for the stretched components' equations (namely Erho and Ephi in this case)?
Your normal media conductivity has nothing to do with the PML one. Especially in a stretched space formulation this is much easier to see why. The PML "conductivity" is just a loss term that is used to attenuate the right components in the PML. For a correction based PML implementation you can try this http://dx.doi.org/10.1109/TAP.2011.2180344
but I have never used it in cylindrical coordinates and obviously as I have developed it I should not be the one to promote it ... Good luck.
Question
To approximate numerically the solution U we consider the Galerkin space discretization and time discretizations based on the Crank-Nicolson method and on the fourth-order Padé approximation R2,2.
What are the steps required to compute the approximate solution Un+1 at the time level tn+1 using both these discretization schemes?
Hi Ghaffar! Once you have descritized and your numerical scheme is obtained. I suppose you have a two level scheme. Taking initial condition as Un , compute your rhs. Apply boundary conditions to obtain a system of equations whose size depends on the points taken along space direction. This system will be linear if given PDE is linear else it is non-linear. Solve it to obtain solution Un+1.
Now Un+1 is obtained , transfer it to Un and get solution at new time step 2Dt as explained above.
Question
Which one shows more stability and accuracy of the numerical solutions?
1). Lax-Wendroff method with consistent mass matrix
2). Lax-Wendroff method with diagonal mass matrix
Which equation are you trying to solve ?
First order or secund order or hyperbolic ?
Best regards,
MH
Question
See above.
All the numbers determine a stability of numerical scheme. As common, if they reach some critical limit, the numerical solution begins oscillate in space and time with grid period. That oscillatory solution is non-physical and grows rapidly providing the numerical overflow.
I think, the detailes of numerical scheme stability analysis and recommendations about the scheme choosing can be found in any book about the CFD or heat and mass transfer simulation, e.g.:
"Computational Fluid Dynamics" by K.A. Hoffmann;
"Computational techniques for fluid dynamics" by C.A.J. Fletcher;
"Numerical Heat Transfer and Fluid Flow" by S.V. Patankar;
"The Theory of Difference Schemes" or "Computational heat transfer" by A.A. Samarskii;
"Essential Computational Fluid Dynamics" by O. Zikanov.
Question
How can we introduce dynamic effects in FLAC3D itasca codes?
Question
For defining desired material property.
I can highly recommend the following book which are relatively new published in 2008:
Title: COMPUTATIONAL METHODS FOR PLASTICITY - THEORY AND APPLICATIONS
Authors: EA de Souza Neto, D Peri´c and DRJ Owen
Publisher: Wiley
ISBN: 978-0-470-69452-7
The book is very easy to read ( considering the topic ) and covers almost every aspect of computation plasticity (800 pages), small and large strain formulations, isotropic and an-isotropic formulations, elastoplastic formulation, flow rules and plastic multipliers, viscoplasticity, etc
Best of all each topic is started out in one dimension and then expanded to a full 3D formulation. Furthermore, the book is very easy to implement from, as each constitutive formulation is summarized in pseudo code - documenting the implementation step by step.
The book give a general introduction to constitutive modeling and is by far the best book I ever read on this very interesting and challenging topic.
Regards
Benny Endelt
Question
Finite difference method
Question
In the famous book of A. Taflove "Computational Electrodynamics" magnetic field time updates are about n+3/2 and n+1/2 timesteps. The same time updates in Numerical Electromagnetics - the FDTD Method - U. Inan, R. Marshall (Cambridge, 2011) appeared between n+1/2 and n-1/2 timesteps. I know that there is no difference between them, as there is only one timestep between two different times, but I think that I am missing something. Any help will be appreciated.
Hi Dimitris, when we say that time updates of magnetic field at (n+1/2), we mean that the magnetic field values at (n-1/2) and electric field values at n are used to calculate the magnetic field value at time (n+1/2) [the electric and magnetic fields are interleaved in space also, but I am only specifying the time indices for the sake of understanding]. So, when you say, "magnetic field time updates are about n+3/2 and n+1/2 timesteps", it probably means you are trying to get the magnetic field values at (n+3/2) in terms of the magnetic field values at (n+1/2) and electric field values at (n+1). So they seem to be consistent, only with the difference that in one case by present time step we mean (n+3/2) and in the other case the present time-step refers to (n+1/2). I had a look at chapter 3 and 4 of Taflove once again, the update is the same as that of Inan and Marshall. Can you please specify the particular portion of Taflove's book? I might get a clear picture.
Question
If any one knows how implement the PML absorbing boundary condition in full acoustic wave equation using finites differences of second order in time and space. I want to compare with the conditions implemented by Cerjan (which multiply the preasure in an exponential factor), I think PML are formulated in a different manner not as a factor.
Question
In the case of my research, I'm using direct numerical simulation to compute the flow around a cylinder for the laminar case (Reynolds around ~ 100) using high order finite difference scheme (6th order). The cylinder is subjected to one-degree-of-freedom vortex-induced vibration in the transverse direction to the flow (y axis).
Right now, I compute the aerodynamic/hydrodynamic coefficients (drag and lift coefficient) using the conservation of momentum equation which uses a control volume. Due to the cylinder displacement, there is a lot of noise in the time signal of the coefficients.
Is this the most efficient way that minimizes numerical error? For example, a paper by Shiels (2001) uses a vorticity formulation to compute aerodynamic coefficients (referred on link).
Dear Sir,
1- First of all you have to make inflation around the cylinder about 5 layer and
2- after get the run and have the answers, you have to select' area weighted average' and snap to select the parameter and get the 'Pressure' then select ' coefficient of pressure'.
good luck
Question
I want to calculate order of accuracy of Finite Difference Scheme with non-uniform grids. Here analytical solution is not available. Please suggest some idea..
To have some idea whether the finite scheme is working fine or not choose grid points N, 2N and 4N. Assume solutions for 4N points as accurate, compute Max. Absolute Errors in N and 2N grid points.Find order of accuracy from here by using formula       log( E/ E2N) / log(2).
Question
While reading an articles on Shock capturing schemes for high speed flow, i encounter the jargon "dissipative term" several times. Can you please explain me what does it mean particularly? Which term in governing equations represent it? It will also be helpful if you can suggest some literature to be familiar with the jargon used in CFD?
Viscous dissipation in general  is the irreversible conversion of mechanical energy to internal energy (heating) due to viscosity. See this link for more details: http://rheology.tripod.com/z07.13.pdf
Question
numerical model of dehumidifier has been solved using the finite difference scheme.
When I calculated rotary heat exchangers i used to calculate a heat balance error.
But note if you make a very accurate solution of the model, it does not mean it  is accurate if you compare with practical tests.
Question
I am trying to solve time dependent Ginsburg Landau equations for superconductor-vortex structure using Finite Difference Method (forward time centered space). Set of equations and time development are shown in the attached file.
I am trying to solve the same set of equations using the above said scheme in FORTRAN.
1. my results are not as same as reported in this paper.
2. vortexes in my calculation are not dynamic (they appear at specific positions but do not move rather new vortexes appear at new positions)
3. in my calculation vortexes appear at very low magnetic field setting (i.e. h=0.82 but these figures are at h=10)
solution develops from boundary to inside in FDM, is it the reason that i cannot get correct picture at an intermediate time step? I have been working for several months on this equation and i am stagnant at this point.
Any Suggestion would be extremely encouraging for me..
Explicit methods is where you are only using grid points at the current time step to approximate the solution at the next time step. Implicit methods use information from the next time step to set the solution at the next time step. Really the major different is explicit schemes just require you to update, implicit require you to either solve a linear system, or solve a root finding problem, based on if the PDE is linear or non-linear.
Question
Dear Friends,
i tried to model tunnel supports using beam elements in FLAC 2D. now i have a problem with calculating the SF of Beams in the model
You can use fos command or use the strength reduction factor rechnique
Question
Can we use interchangeably the convolution operator and the finite difference one?
In the some 2D image application cases, one can confuse these two operators, The steady state of an iterated convolution leads to same results as the one of the finite difference operator. can some one give some proofs to this proposition.
At least on uniform grids, finite difference operators become Toeplitz matrices.
Convolutions, too, are Toeplitz matrices on finite sequences.
Now, the fact is that Toeplitz operators, (i.e. infinite dimensional Toeplitz matrices) commute, as they share the same (Fourier-type) eigenvectors. This means that for infinite-dimensional systems, you can apply convolutions and finite difference operators in arbitrary order.
For finite dimensions this is not true, but the "commutativity" still holds at interior points. Thus it's only on the boundary that non-commutatiivity shows up. You will have to create a small boundary correction, but if you have very long data sequences, this is not such a big problem, as convolutions and finite difference operators are "almost commutative."
So the answer is that you may apply the operators in any way you prefer, if you only pay attention to what happens at the boundaries.
Question
Hello, I am developing a simple 3D fortran solver in finite difference using Modified SMAC scheme. My domain is 2pi*2pi*1 as taken by S. Chandrasekhar. My equations are having non dimensional parameters as Reynolds Number, Rayleigh Number and Prandtl No.
The code is running well but w- velocity contours(heating at bottom and cold at top) are coming only positive and negative alternatively and i am not getting rolls as expected. Can someone explain it.? Thanks in advance
The problem with boundary conditions described in your question is quite well known. I will start from the simple scheme in which the derivatives inside of the domain are calculated using the central differences. On the lower and upper boundaries I will apply forward and backward differences respectively. This solution is usually acceptable for most of the problems including convection in the Cartesian and spherical geometry.
If you are looking for more accurate solution I would like to suggest to read
Strict Stability of High-Order Compact Implicit
Finite-Difference Schemes: The Role of
Boundary Conditions for Hyperbolic PDEs, I
Saul S. Abarbanel and Alina E. Chertock
Journal of Computational Physics
160, 42–66 (2000)
Based on my recent experience it looks that the both solutions can be used to solve the boundary value problems.
In the past I was using often the book:
Fundamentals of Computational Fluid Dynamics
by Patrick J. Roache
where all problems of computational fluid dynamics are discussed very clearly and in accessible manner.
All the best in your calculations,
Janusz
Question
Edge detection, w-mask , finite difference, image processing
Question
Hello, I tried to determine the dynamic coefficients of a 2 groove journal bearing, the program is attached, I tried to compare the results obtained by other researchers such as SOMEYA & LUND but the results show a significant difference.
I would be thankful if anyone review the program, or if there an existed one that I can use.
I come from China, Xi'an jiaotong university , we share the same subject , I read you program .also I run it ,thus I get the good static characteristics which match the lund's result but I can not get the good dynamic characteristics. particularly,for the cross damping coefficient (Cxy,Cyx),I can not get the Cxy=Cyx, so I think there must be some
errors when we caculate the parameters (A1,A2....A11). now, I can not locate this error. i think we can figure it out together.
Question
Hi, Folks!
I am going to use finite displacement (sometimes called finite difference if I am right) to calculate phonon of my crystal. As I read from some articles and online forums, we should build a supercell first, then move one atom each atom by a given distance. I have two questions concerning supercell.
1)How could I know how large supercell (2*2*2 or 3*3*3 or even larger) I need to  build to satisfy the phonon calculation?
2)What's more, should I also increase k-points correspondingly? For example, if I use 4*3*3 for unit cell, then I need to increase to 32*24*24 in case of 2*2*2 supercell.
1) I agree with Andrew. There are rules of thumb to decide the size of the supercell, and in general the larger the better. If you are interested in a properties a good choice (if computationally available) is to start from 1x1x1, to 2x2x2, 3x3x3 and so on, until the properties converges.
2) K-points mesh has to be reduced if larger direct space cell is considered ( smaller k-space). But again you need to accurately covnerge the k-points. FDM requires well converged parameters.
Also you need to geometrically converge the cell below the usual threshold (10meV/A). I personally used 1meV/A, but it depends on the system.
3) I would suggest Atsushi Togo phonopy software to perform those calculations.
Question
Hi,
I know integrating u and v will give me the streamfunction at each point in a grid but can someone explain me how to achieve this using finite difference numerical integration in MATLAB ?
Question
Hello, I have a nonlinear PDE with complex numbers(i.e. imaginary) with three variables two of them was calculated by another equation using FDM, now I want to solve this eq. but I don't know how to use FDM with the complex term.
The equation is attached.
Any help.
Thanks Nasir Haniffa, yes the independent variables are real and the dependent also are real except (Q_E10). so I'll separating the real and imaginary parts and solve them. I'll let you know about the results.
Question
Anybody can explain why WENO scheme is not considered to be TVD.
Is there any implication of this fact on reconstruction data having large gradients ?
What about MPWENO, is this method abstain the emergence of oscillation in the vicinity of large gradients when using WENO?
Ory. WENO uses divided differences  to determine smoothest interpolation stencil (smallest total variation TV), TVD schemes apply upwind when oscillations are detected smoothing the solution by numerical diffusion. At the discontinuity TVD becomes first order accurate whereas WENO tries to remain non-oscillatory and higher-order by selection of the proper interpolation stencil(s). WENO (weighted ENO) takes some kind of the average from all discretization stencils for this reason it is less non-TVD then original ENO scheme.
Question
How to include the flux boundary over irregular aquifer domain using finite difference analysis??
hi
if you use FDM and have specified differential equation and boundary conditions it is easy to implement boundary condition to FDM. So the most difficult form of boundary is mixed or robin boundary condition that you could implement it into your domain by ghost node method ( fictional node method). check it on the net.
regards
Question
Can anyone gives me the details description of two level finite difference approximation method?
I am not sure if you mean only the use of second and higher differences in numerical approximations, but some older texts have very thorough expositions.
three  are: Mathematical Physics Jeffreys and Jeffreys Chapter 9  CUP 1956
Methods of Mathematical Computation Herriot, Wiley 1963
Modern Computing Methods UK National Physical Lab Philos Library NY 1961
Question
Dear all,
I'm trying to model the breakthrough curve for an adsorption packed bed column. By making use of a Crank-Nicolson scheme I've discretized the general mass balance equation (diffusion advection equation) where I now want to add a source term which will describe the actual adsorption.
I'm building the model according to the following article since the same assumptions are valid for my model:
I did not succed in modeling the adsorption term in the model. I'm unsure how I have to discretize this term in the axial direction. I was advised to add the adsorption term by making use of the fractional step method. Is there anyone who has experience with this?
All forms of help are highly appreciated!
Cheers,
Stijn
Start by linear izing the adsorption term.
Question
Hello everybody,
I have implemented a numerical model which consists--among others--of a Finite Difference scheme that is used to solve the quasi-stationary magnetic diffusion equation in three dimensions; i.e., a modified version of the Laplacian operator in Cartesian coordinates. For solving the generated system of linear equations (A)x = b I use the SOR algorithm. The model ran well so far, no matter what input I chose. I should mention that the system matrix A consists of complex-valued elements.
However, for some input parameters the SOR solver does not deliver useful results, or more specifically, it does not converge to the given level of accuracy at all. The system matrix has 8e6x8e6 entries which shouldn't be a problem because, for most input parameters, the SOR algorithm delivers physically correct results. It has to have something to do with the entries of the system matrix per se.
For solving the equation on the Cartesian grid I use the 7-point-stencil. If the unmodified version of the Laplacian operator is solved, the weighing factor at the actual node (i,j,k) is -6. In my modified version, it is -6 + i*x, where x denotes the imaginary part. I even tried SPQR from the SuiteSparse package provided by Tim Davis but since this is not an iterative method MATLAB throws an "out of memory" error (I can use up to 192 GiB (!)). It would really be great if someone encountered a similar problem and wants to share their solution. If interested, I could upload the system matrix as well as the boundary condition vector.
Thank you very much in anticipation!
Best regards,
Chris Volkmar
Hi Chris,
the SOR method can diverge if the matrix is not self-adjoint positive definite. However the convergence can be very slow even for self-adjoint matrices.
The first thing that you should try is one of the Krylov subspace method, i.e., the Conjugate Gradient method (for self-adjoint positive definite matrices) or the GMRES method (for general matrices). These methods only require the implementation of the matrix-vector product and the scalar product. Thus are easy to implement.
If these methods do not yield a desirable speed of convergence you can still go for more elaborated methods like preconditioned GMRES, Multigrid, AMG, AMLI, etc. But try the simple methods first. ;)
You can find the methods e.g. in Saads book (see link below).
Regards
Question
I was working on a simulation of Heat transfer block process that contain (liquid, steam and superheated steam). Unfortunately,  all the equations of the heat transfer model consist of a 3rd order P.D.E., I already know the finite element, finite volume and finite difference method. However, applying those methodology never worked with my situation here
So, I wonder if their is a more simpler way for numerical solving of P.D.E. I am currently using MATLAB r2010a to run the simulations
Thanks in advance for any contribution to this subject
Best Regards,
These are classic Navier Stokes equations and heat transfer or energy equation. I do not believe these are of 3rd order, however they are highly nonlinear and extremely difficult to solve with your own codes. It is recommended to use already available commercial software like ANSYS, COMSOL, or ABAQUS to solve such type of problems as they have the required solvers for such problems. A large number of example problems are also available with these software. They are mostly finite element or finite volume based software.
P.S. MATLAB have a very elementary PDE toolbox for solving PDEs. These equations can not be solved with that.
Question
In FLAC geosynthetic is model as linear elastic material. Is it possible to simulate  failure of geosynthetic due to large deformation? I am using FLAC3D version 3.1.
Question
There are many functions whose anti-derivatives (primitives), even though they exist, cannot be expressed in terms of elementary functions (like exponential functions, logarithms, trigonometric functions, inverse trigonometric functions and their combinations). I want to ask if it was the same for anti-difference operator of some functions. In other words , can we express the anti-difference operator exponential functions "exp(P(x))" in terms of elementary functions?
In general, no. The anti-difference operator applied to exp(x2) is a finite algebraic combination of anti-derivatives that cannot be expressed in terms of elementary functions.
Question
I am trying to write the matlab code for following expression :
u(i-(1/2),j+1)+u(i+(1/2),j+1)+u(i+(3/2),j+1)=u(i-(1/2),j)+u(i+(1/2),j)+u(i+(3/2),j) , i=1 to n-2, j=1 to m, with initial condition and Dirichlet conditions.
Is this a time-domain finite-difference scheme or a frequency-domain finite-difference scheme?  The implementation of these two is VERY different.  I don't see any time parameters so I assume this is some sort of steady-state or frequency-domain analysis.  There appears to be some terms missing.  If the equations are describing finite-differences, they need to be divided by something.  I would suggest providing the original analytical equation.
Anyway, if you want a brief introduction for steady-state (using linear algebra), check out Lecture 9 here:
For a time-domain scheme, check out
Question
Dear all.
i would understand more the difference between finite elements analysis and finite difference analysis (eg; plaxis vs Flac)?
best regards.
Dear sir
thank you very much.
best regards
Question
Dear all
can i know how to apply the inclined load with the software FLAC 2D?
Question
Why is the phase of the input wavelet rotated +- 45º when 2D finite difference modeling is performed for seismic wave propagation?
By Dablain (1986) and others I know that this does not happen for 1D and 3D modeling, only for 2D. Could someone provide me also some reference?
The phase shift is associated with the properties of waves on a 2-D membrane.  Morse and Feshbach, 1953 (Methods of Theoretical Physics, Part I, Section 7.3, and especially Figure 7.11 and the summary on page 893-894) give the Green's functions for 1-D, 2-D and 3-D media.  In the time domain in 2-D the pulse shape has a "tail" that is not present in the 1-D and 3-D solutions.  This tail corresponds to a Hankel function in the frequency domain (page 891) which has a frequency independent phase shift of 90degrees (-i).  Also see Chapman, 1978, GJRAS v54, 481-518.
Question
Hi,
I am trying to use Chebyshev pseudospectral method to simulate 3D wave propagation problems. The solver works but is very unstable. I applied mapping functions to make the boundary mesh grid larger but still instability is very apparent.
I read staggered grid tends is helpful in improving the stability of a finite difference solver. I am wondering if that can applied to pseudospectral method. How can it be used in Chebyshev method, in particular?
Any suggestions will be appreciated. Thanks.
Bo