498 questions
2
votes
0
answers
59
views
Having problems computing PDE Residuals
I'm computing PDE residuals for The_Well datasets (e.g. turbulent_radiative_layer_2D and shear_flow) using finite differences, but the residuals are much larger than I expect. The data are generated ...
0
votes
0
answers
68
views
Julia ModelingToolkit Method for Dx(var) * Dx(var)
I am trying to use the Julia language to solve a system of partial differential equations. I found the modeling tool kit to be quite helpful. I can solve the unsteady heat equation for multiple ...
0
votes
0
answers
122
views
How to apply the method of lines (MOL) with scipy odeint function with Danckwerts boundary conditions?
I am trying to solve a convection-diffusion-reaction problem for a tubular reactor. The reaction governing the process is as follows:
The method I chose to solve it is the line method, which consists ...
1
vote
1
answer
98
views
Trouble Plotting short term Solution on Maple
I’m trying to solve a problem from Modern Mathematical Methods for Scientists and Engineers using Maple, specifically applying the Fokas method (Unified Transform) to the heat equation on the half-...
0
votes
1
answer
98
views
Why is reshape/ravel in NumPy faster (or about as fast) than explicit flat indexing for 2D PDE solvers?
I'm solving a 2D PDE using solve_ivp from SciPy and was trying to optimize my function by avoiding calls to .reshape() and .ravel() on every timestep. I rewrote my dudt function to operate purely in ...
-1
votes
1
answer
88
views
More sweeps vs shorter timesteps [closed]
Question
Is it better to use larger timesteps that necessitate more sweeps, or shorter timesteps that permit fewer sweeps? I define 'better' as meaning a better 'accuracy-to-computation' ratio.
...
1
vote
1
answer
88
views
Heat equation units in FiPy
Question
Am I correct in using volumetric properties when simulating the heat diffusion equation with FiPy?
Context
I am solving the transient heat diffusion equation with an explicit source term.
...
0
votes
0
answers
74
views
Robin boundary conditions for PDE - fipy
I'm trying to use fipy to solve a PDE system. In this case, I have a coupled of PDEs and I need to solve for two components of a vector field (m1 and m2). However, I dont need to solve these ...
1
vote
1
answer
63
views
Solving a PDE backwards with FiPy
I'm trying to simulate the dynamic behaviour of the granular flow inside a rotary kiln. The PDE describing it was derived by Descoins (2005) and it is expressed as follows:
The original equation (...
0
votes
0
answers
52
views
The plots appear weird after 200+ timesteps
I am trying to simulate grain boundary properties in a ferroelectric bicrystal using FiPy.
I have basically three variables to solve namely, degree of crystalinity (eta), polarization magnitude in the ...
1
vote
0
answers
53
views
Modifying the launcher manifest of an Eclipse RCP Application
I need to make some changes directly to the executable responsible for launching my RCP application. In this case, I'm modifying the manifest using the "mt.exe" tool from the Windows SDK.
As ...
1
vote
0
answers
135
views
Solving fractional partial differential equation with finite difference method
I am facing stack overflow error when I am trying to solve numerically the fractional nonlinear Schrödinger equation using finite difference method in python.
This nonlinear partial differential ...
0
votes
0
answers
69
views
Negative Eigenvalues of the Woods-Saxon Nuclear Potential for Oxygen ND Eigensystem
I am trying to use ND Eigensystem to find the eigenvalues of the Woods-Saxon Potential Schroedinger Equation for Oxygen. I've defined the potential and operator, but I know the functions given are ...
-1
votes
1
answer
110
views
How to best solve partial differential equations in Python accurately but quickly
I am trying to reproduce 4.1.3 Emission from Solid Materials as per this PDF.
https://www.rivm.nl/bibliotheek/rapporten/2017-0197.pdf
Produced this version of the model and this is the best I have ...
0
votes
1
answer
67
views
Issue Using NIntegrate Function in NDSolve
I am stuck in an attempt to pass an interpolating function that was generated from a PDE solved using NDSolveValue to a second call to NDSolveValue for a solution to a simple ODE. Here is my code for ...
0
votes
0
answers
45
views
Index error while solving PDE's in python with 4th order of accuracy
I am trying to solve coupled heat conduction and mass diffusion for a spherical particle.
I am solving the PDE's using Finite difference method , with 4th accuracy for first and second order equations....
0
votes
0
answers
50
views
difference between analytical and numerical solutions for a PDE problem
first of all I'd like to point out that this is my first time using Stack Overflow so don't hesitate to tell me if something isn't displaying properly or isn't clear.
I'm trying to solve an advection ...
0
votes
1
answer
124
views
Python solving wave equation numerically
My main task is to solve a PDE of the form.
with periodic boundary conditions, say:
so naturally I wanted to first solve the wave equation:
The code I have come up with is this:
import matplotlib....
0
votes
1
answer
135
views
Solve 2d heat equation using solve_ivp
I'm trying to solve the 2D heat equation using the finite difference method as a filtering technique for an image using the solve_ivp method. My code is shown which gives an error message "y0 ...
0
votes
2
answers
122
views
Extracting the values of Fipy diffusion and convection terms
I am new to Fipy and I was wondering if there is a way how to extract the values of a diffusion or convections terms. in the case of a cell variable this is easy but diffusion or convections are in ...
1
vote
1
answer
101
views
CFD Navier-Stokes Equation in Julia
so below is the code snippet i have for Julia:
using Printf
using Plots
gr()
# Parameters definition
Ny = 21 # Number of points in y-direction
Aspect_ratio = 10 # Ratio of ...
0
votes
0
answers
175
views
Solving PDEs in MATLAB for a Simulink model
I'm currently working on a model of Metal Hydrides absorption/desorption in simulink. The model is based on 3 partial differential equations in which there is a spatial coordinate r (along the radius ...
0
votes
0
answers
28
views
MPI works with 4 processor but fails with more, problem with decomposition? Send/Recv? 2d Heat diffusion
I have to simulate 2D plate heat diffusion. Everything works fine with 4 tasks, but it doesn't when using N*4 tasks. I suspect the problem is in the logic of communications between the upper and lower ...
2
votes
1
answer
94
views
Dirichlet boundary conditions using odeint
I am trying to edit the Gray-Scott 1D equation example (last example on the page) in the odeint documentation.
I have the code below and it works for the Neumann boundary conditions but I want a ...
0
votes
1
answer
184
views
Why is there discrepancy in the result with matlab and python?
I want to solve the 1-D transient heat transfer equation.
Define a 1-D geometry (a line) in y-direction
dT/dt = (k/(rho*cp))*d²T/dy²
I.C.: @t=0, temperature of all elements is 25°C
B.C.: The geometry ...
0
votes
1
answer
248
views
PY-PDE : define PDE with partial derivatives and solve it
I am trying to define and solve a PDE with partial derivatives and non-linear behavior using py-pde, unfortunately all the examples I found seem to use simple instruction like gradient and laplace, ...
0
votes
0
answers
526
views
Solve 1-D transient heat transfer equation
I want to solve the 1-D transient heat transfer equation
dT/dt = (k/(rho*cp))*d²T/dy²
Define a 1-D geometry(a line) in y-direction
I.C. : @t=0, temperature of all elements is 25°C
B.C. : The geometry ...
0
votes
1
answer
60
views
How to write a solver for the vibration ODE using the current version of Devito?
I'm reading the devito_book/fdm-jupyter-book/notebooks/01_vib/vib_undamped.ipynb and the code in it seems not compatible with devito 4.8.3.
So I tried to rewrite it as:
import numpy as np
from devito ...
1
vote
1
answer
76
views
Boundary Value problem - multiple argument
I am developing a model for the 1-D geometry product which is exposed to different conditions on the top and bottom surface as you can see in the code. Unfortunately, for the boundary condition, it is ...
1
vote
1
answer
197
views
NDSolve fails to solve partial differential equation [closed]
When solving a partial differential equation, I get
NDSolve::eerri: Warning: estimated initial error on the specified spatial grid in the direction of independent variable x exceeds prescribed error ...
1
vote
1
answer
271
views
How to correctly implement homogenous Neumann boundary conditions in my linear solver?
I am trying solve a linear Poisson's equation with homogenous Neumann boundary conditions at the interval [-1,1] along the y direction and periodic along x. Originally, I tested the same code for a ...
1
vote
0
answers
130
views
Nonlinear PDE solver with Spectral Method using Chebyshev
This bug has been haunting me for a while and would love new pair of eyes to help, not sure if this is the right place for such a question so please let me know.
I am solving a nonlinear Poisson's ...
0
votes
0
answers
55
views
Why is total amount of substance in a diffusion medium NOT constant if flux is zero
I am trying to use this MATLAB code for 2D-Diffusion problem from the File Exchange here. The code is shared below. All boundary conditions are set to zero (zero flux), and I set my initial condition ...
0
votes
1
answer
96
views
Matlab and PDE:can you model a rubber ball being squeezed between two steel blocks?
I would like to model the compression of a rubber ball, being squeezed between two steel balls.
What i want is to be able to demonstrate the contact areas and the local pressure within these contact ...
1
vote
3
answers
195
views
How to numerically approximate solutions to a set of two second order two-variable PDEs using a python script (boundary value problem)?
I have a set of two PDEs like so (pseudo-code):
r'' = (s')^2 * r - G*M*r^-2
r' = -(r*s'')/(2*s')
s and r are functions of time, ' the derivative, G and M are constants.
They were obtained from the ...
1
vote
0
answers
219
views
Periodic boundary conditions in a 2D array
I need to implement the following boundary conditions in my Python code f(0, x) = f(-1, x) = 0 and f(y, 0) = f(y, N) (periodic in the second index).
My code doesn't seem to work. F is a numerical ...
0
votes
0
answers
162
views
Finite Difference Method implementation in Python
I'm trying to recreate numerical results from an article. In particular, I want to numerically solve the following PDE system:
In this system, Fn represents a prey population density, Cn a predator ...
0
votes
0
answers
125
views
Burger's equation (PDE) does not work with step function?
I'm working on implementing the discretised Burger's equation. I am quite confused as to why it does not work with when using a step-function. When using a step-function, I am getting a singular ...
1
vote
2
answers
155
views
Finite difference method converging to wrong steady state (python)
I'm trying to recreate numerical results from an article. In particular, I want to numerically solve the following PDE system:
In this system, Fn represents a prey population density, Cn a predator ...
0
votes
0
answers
67
views
How to Implementing x * dA/dx Terms in FiPy for Coupled PDEs
I am relatively new to FiPy and have spent some time reading the FAQ and examining examples. My goal is to solve a set of coupled partial differential equations (PDEs), one of which is represented by ...
0
votes
0
answers
59
views
Custom Plugin in Eclipse
I am a student, and I am currently working on a project to develop a plugin editor for Eclipse using Java 1.7. So far, I have successfully implemented the syntax coloring feature. To test my plugin, I ...
0
votes
0
answers
507
views
Generating Turing Patterns Using Finite Difference on Reaction Diffusion Equations
For a school project, I am implementing in Python a finite difference method to numerically solve the following system of reaction diffusion PDE:
I have so far implemented the following:
import numpy ...
0
votes
1
answer
99
views
Matlab code for an eigenvalue problem on a L-shape domain
I hava a Matlab code code
model = createpde();
geometryFromEdges(model,@lshapeg);
applyBoundaryCondition(model,"dirichlet", ...
"Edge",1:model....
0
votes
0
answers
124
views
solve pde with BC in python
I have this partial differential equation ut=0; with this boundary condition: u(x,0)=x
and I want to solve it with pdsolve in python
from sympy import *
from sympy.abc import x, t # x and y are the ...
1
vote
1
answer
291
views
How to extract chunks of a 2D numpy array that has been flattened
I would like to know the best way of extacting chunks of elements from a 2D numpy array that has been flattened. See example python code below which hopefully explains what I want to do a little ...
0
votes
1
answer
77
views
Wrting MATLAB Code related Laguerre Polynomial but getting errors
I'm trying to write code of these equations:
Laguerre Polynomial:
and Laguerre Polynomial Coefficients:
So far I have written this MATLAB code of Laguerre polynomial:
function M=Laguerre_Polynomial(...
1
vote
0
answers
295
views
How to get damping matrix for structural model in FE analysis
I need to implement in C a method of obtaining transient solution Rdm of damped FE models based on modal results R for a structural model (imported CAD geometry) defined with hysteretic (structural) ...
1
vote
1
answer
99
views
Computing Triple Summation in MATLAB
I have a general solution to my heat equation as:
I have tried implementing this in MATLAB but I get inconsistent results. Do you think the issue is about my code or just the triple summation does ...
2
votes
1
answer
444
views
3D Heat Equation in MATLAB
I am trying to model in MATLAB the temperature distribution inside a rectangular prism with boundary and initial conditions and heat equation I was trying to visualize 2D slices in the 3D shape. ...
0
votes
1
answer
66
views
How can i offset the Fipy mesh?
i'm solving some PDE's using Fipy and it would be really handy to translate the mesh so it doesn't start at 0 instead of modifying all my equations.
This is important since my convection term is ...