# Questions tagged [matlab]

Questions about the numerical programming language MATLAB.

157 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0answers
74 views

### How can I practice multivariable root-finding?

Recently, I've been reading up on various root-finding / optimization algorithms such as the Levenberg-Marquardt method, Gauss-Newton, Conjugate Gradient, trust-region and trust-region-dogleg. I've ...
0answers
61 views

### ode15s command for coupled PDEs

I am trying to solve the coupled PDE system given here-Solve System of PDEs, using the method of lines and the ode15s command. Referring to variables $u1$ and $u2$ as $u$ and $v$ respectively, I have ...
0answers
153 views

### Two-dimensional modelling of a flate-plate reactor

I am trying to simulate the unsteady pollutant concentration along the reactor by solving the 2nd order PDE below with the stated BC and IC. which method is appropriate to solve convection-diffusion-...
0answers
43 views

### Finding isocontour lines, populating points on said lines (in MATLAB)

I'm trying to extract data from a potential field. I have an example code of a potential field, using meshgrid in MATLAB. I've pasted the code below. What I'd like to do next is 'convert' this field ...
0answers
38 views

### How does Block-diagonal Schur factorization in Matlab works?

Can anyone explain how does the bdschur command of Matlab works? And how should the CONDMAX and ...
0answers
45 views

### Inverse Newton Method for optimization: is this the correct algorithm?

I am trying to implement the algorithm in this article. I have already asked a question before about it here, and I am trying to figure out what I am doing wrong. This time, it's this section of the ...
0answers
72 views

### Using MATLAB to simulate the Ising Model

I am using MATLAB to simulate a 1D Ising Chain. I am running into an issue where when trying to find heat capacity, my system has a tremendous amount of noise. I'll post my code and an image of the ...
0answers
70 views

### Solving diffusion equation using finite difference method

I am solving an 1-dimensional diffusion equation with Neumann boundary condition at outlet and constant concentration, C, at the inlet. In the end, I want to observe how the concentration diffuses ...
0answers
362 views

### High-accuracy numerical differentiation

I have a $200 \times 200$ matrix representing the values taken by a function over an equally spaced grid. I would like to perform derivatives on it. I am interested in its gradient (i.e. its ...
0answers
18 views

### Translating grid with extrusion speed

I am putting into MATLAB code the equations that describe a plastic extrusion process. From a paper, I found I should use a spatial grid that translates with the extrusion speed, being the reference ...
0answers
173 views

### Finite differences for the one-phase Stefan problem

I am trying to code the one-phase, one-dimensional Stefan problem using finite differences in Matlab, similarly to what has already been done in Mathematica (see https://mathematica.stackexchange.com/...
1answer
180 views

### Prescribing variables as an excitation in Runge-Kutta method

I am using Runge-Kutta to solve a $3 \times 3$ 2nd order linear ODE $$M x'' + C x' + K x = 0$$ and initial conditions are all zeros. Then I prescribe the 2nd variable to follow a given path. As for ...
0answers
61 views

### scaling in discretized PDE system

I want to solve the following system via Matlab $\Omega=(0,1)^2$ $$\Delta y=\frac{1}{\alpha} p$$ $$-\Delta p= y -1$$ $$p|_{\partial \Omega}=0,~y|_{\partial \Omega}=0$$ using ...
0answers
113 views

### Band structure of nonlinear Schrodinger equation with one dimensional potential

I have a nonlinear Schrodinger equation which reads: $$\frac{1}{2} \frac{d^2u}{dx^2}+ |u|^2u + V(x)u = -i \frac{du}{dz},$$ where $V(x)=\cos(wx)+ i a \sin(wx)$ and $w$, $a$ are numbers. How to ...
0answers
56 views

0answers
44 views

### Solving HJ using Hopf-Lax formula (Burgers case)

Hi I want to approximate $u(x,t)$ solution of: $\begin{cases}u_t+H(u_x)=0 \\u(x,0)=u_0(x)= e^{−(x−3)^2} \end{cases}$, where $H(u_x)=\frac{u_x^2}{2}$ and my spatial domain is $\Omega=[0;10]$. Now i ...
0answers
1k views

### Nelder-Mead algorithm with constraints

Im currently implementing a Nelder-Mead algorithm in MATLAB that can deal with constraints. In detail, the constraints should be added to the objective function with a Lagrange Multiplier($\lambda$) ...
0answers
100 views

### Adjoint of the MATLAB $\tt dwt3$ (3D wavelet transform) operator

How do I compute the adjoint of MATLAB's dwt3 operator? In other words, how do I compute the adjoint of the linear operator that takes a 3D complex array ...
0answers
70 views

0answers
166 views

### Simple MCMC Algorithm in Matlab

I would be really glad to get some specific advise on how to implement a simple MCMC algorithm (in Matlab, if possible). I'm not yet too familiar with optimization methods. My problem goes as follows: ...
0answers
660 views

### radially averaged power spectrum of a binary image does not look like power law

It has been known that Fourier power spectrum somehow obeys power law therefore the slope of the spectrum can be used to calculate the fractal dimension of an image. Many people have used it for ...