Questions about the numerical programming language MATLAB.

learn more… | top users | synonyms

0
votes
3answers
93 views

Numerical simulation of a reaction-diffusion system on MATLAB with finite difference discretization of spatial derivative

I have a model of a system which consists of diffusing reactants and intermediates. For each variable, $u_i$, the final representative equation looks like the standard reaction-diffusion form: ...
0
votes
1answer
70 views

How can I generate 3D unstructured mesh on MATLAB

I have been looking to do a 3D mesh for a shallow tunnel FE analysis. The output of mesh node orientation along the element should be counter clock wise direction. How and which material helps me best ...
0
votes
0answers
17 views

How to apply asymptotic matching condition in bvp4c?

I want to know how to write the code to apply asymptotic matching condition? In the paper, it is stated that they apply asymptotic matching condition for the range of ...
0
votes
0answers
49 views

Calculating derivatives

I have this formulation and want to calculate its derivatives using a mathematical software, either Matlab, Mathematica or anything else. Is there any way by which I can obtain the second equation ...
1
vote
0answers
16 views

How to find active region in treepartition Matlab object

I am trying to identify a non-linear plant using the identification toolbox of Matlab. In particular I would like to identify a non-linear arx model, where the nonlinearities are expressed by means ...
0
votes
0answers
28 views

3D plot from Fourier coefficients in Matlab

I would like to construct a surface on a 2D mesh, given a set of Fourier coefficients for the original function $V(x,y)$. Given some $\mathbb{K}\subset \mathbb{Z}^2$ I have a partial double sum of a ...
1
vote
0answers
30 views

I need to deconvolve the image of a fluorescent bead without the Point Spread Function in MATLAB

I am aware that I could use deconvolution algorithms such as LUCY, Weiner and Blind but I am confused as to how to estimate the PSF (point spread function), which is needed for the LUCY and Weiner ...
1
vote
1answer
42 views

Solving second order SDE with Gaussian white noise for first time derivative in Matlab

I'm having trouble solving a second order differential equation with Gaussian white noise. The equation I'm solving follows the form: $$Ax'' + Bx' + \sin(x) = i + i_{n}$$ where $i_{n}$ is the ...
0
votes
0answers
75 views

Solving first order system in MATLAB

I have problem to solve this in MATLAB. The equation already in first order system, yet I still confused to write the code and solve it. Or this equation cant be solved by using bvp4c perhaps? ...
0
votes
0answers
28 views

Shooting method MATLAB upper order non linear ODE [duplicate]

How can I solve a system of nonlinear differential equations using Matlab? I know I need to use the shooting method but how should I do it? I know I have to control the value of f'' so that it ...
1
vote
0answers
73 views

3D Diffusion Equation in Fourier space

I'm solving the 3D Diffusion equation $$u_t=k(u_{xx}+u_{yy}+u_{zz})$$ in MATLAB using Fourier techniques. I assume a 3D Fourier expansion $(e^{-ipx},e^{-imy},e^{-imz})$of the solution. Physical ...
3
votes
1answer
60 views

How can I minimize the number of non-zero elements in the solution vector subject to linear constraints (MATLAB)?

all, I've tried to find an answer to this question and have come across some related threads but nothing I was able to apply to my problem given my relative lack of experience in this arena. I ...
0
votes
0answers
36 views

Extracting sinograms from tomography projections

my name is Lorenzo and I am a postdoc researcher in Italy. My job is related to tomography imaging using synchrotron radiation. This is a new field for me and I start to face with Matlab to write some ...
7
votes
3answers
142 views

How to compute the rank of a large sparse matrix in MATLAB

I am interested in computing the ranks of fairly large, the largest being of magnitude $10^6$ x $10^6$, sparse matrices whose entires are all 0, 1, or -1. I have been trying to use Matlab to ...
1
vote
1answer
140 views

Shooting method - Matlab ODE

I'm trying to solve these equations of hypersonic adiabatic flow over a flat plate. I did all the simplifications and got these equations for the stagnation point flow. $$\left(Cf''\right)' + f f'' = ...
3
votes
1answer
123 views

Solving system of 7 nonlinear algebraic equations symbolically

I have a system of seven nonlinear equations that I want to find their symbolic solutions. The solution will depend on the parameter K, and I should have different solutions by varying the parameter. ...
-3
votes
1answer
126 views

How can I solve stiff equations by method of line (MOL)?

I want to solve 7 coupled equations.I use method of line(MOL) and discrete the equation in Length and radius and convert them to a system of ODEs in time.and use ode15s to solve them in MATLAB. But an ...
1
vote
3answers
110 views

solving PDEs in MATLAB

I want to solve 3 coupled equations. I converted them to a system of odes in time and discrete it in Length and radius. Now I have a problem in one of the equations in first point. Because in this ...
4
votes
2answers
115 views

Known issues with eigenvalue numerics?

Are there any known issues (such as precision issues) with $\mathsf{MATLAB}$ eig and charpoly functions for large enough $\{-1,0,+1\}$ matrices? Even if I change $1$ or $2$ entries between matrices ...
3
votes
1answer
73 views

Is the “practical” complexity of linsolve direct solver O(n^2) ?

I recently timed the linsolve direct solver and I was kind of shocked to see that the solver seemed to be scaling quadratically even upto a 1000 dimensions. Specifically I ran the following code and ...
0
votes
0answers
37 views

pdist octave/matlab

I am using MATLAB's pdist function to calculate the pairwise distances in 3D. So far, my data is stored in an array called r, ...
0
votes
0answers
28 views

maltab ode solver- user defined criteria to stop calculations

is there a way to add a user defined convergence criteria to an ode solver so that the solution is stopped? I know that Matlab uses absolute and relative tolerances but would that suffice in solving ...
0
votes
3answers
49 views

How to plot a price level matrix in Matlab?

I have a matrix P of m rows and n columns. P(i,j) contains the price of occupying position i at time j. I want to plot this in Matlab but in a way to get some kind of density plot with different price ...
0
votes
0answers
52 views

Matlab help with differential equations [duplicate]

For my coursework I have to model human hair in which I have $$\frac{d^2\theta}{ds^2} = s f_g \cos(\theta)+s f_x \cos(\phi)\sin(\theta)$$ Where $\theta$ is a function of $s$. I am given the ...
1
vote
0answers
38 views

How to get mathematical model from a data set with MATLAB

I have some values imported from excel about the annual sell of a product, with 3 var: month, price, sold items I have seen how to plot a chart using curve fitting tool but I need to define a ...
1
vote
1answer
104 views

Numerical method for a BVP with mixed boundary conditions (MATLAB)

I've been given a second-order non-linear ODE: $$\frac{d^{2}\theta(s)}{ds^{2}} = sf_{g}\cos{\theta} + sf_{x}\cos{\phi}\sin{\theta}$$ where $f_{g}, f_{x}$ and $\phi$ are constants. The boundary ...
0
votes
0answers
61 views

Solving the transient heat convection diffusion equation (2D) using BTCS in Matlab with derivative BCs

I'm really stacking guys on how to solve the Solving the transient heat convection diffusion equation (2D) using the full implicit BTCS in Matlab with derivative Boundary condition and variable ...
0
votes
2answers
68 views

Plot vector field in matlab

I have the function of an electric dipole expressed in cartesian coordinates and I want to create the vector field using Matlab . The function is $$E_z= \frac{p}{4\pi\epsilon_0} \cdot ...
2
votes
0answers
70 views

Modeling First Order Parabolic PDE (Battery Storage Model)

I'm trying to solve the following first order parabolic partial differential equation, \begin{equation*} X \frac{\partial V}{ \partial Q} = -\frac{1}{2} \sigma^2 \frac{\partial^2 V}{\partial X^2} + ...
0
votes
1answer
107 views

Calculation of error

I have written a code in which I find the approximation of the solution of this elliptic problem. I calculated the error using the following part of code: http://pastebin.com/7b5mmuRW but I get the ...
0
votes
1answer
58 views

Integrating a function and then plotting it's graph in Matlab

I've been working on this code for some hours and it seems I'm doing something wrong which I just can't figure out. I have a function which I integrate and then plot it's values. But the graph I get ...
3
votes
3answers
236 views

Does OOP work easily and efficiently in parallel computations? [closed]

I am working on a task for which the object oriented (OO) approach fits well. I am doing it in MATLAB, since I am in the prototyping phase. However, I know that later I will surely have to perform ...
2
votes
1answer
93 views

MATLAB : Does the qr algorithm and the DGEMM used in MATLAB take into account if the input matrix is tridigonal and optimize accordingly?

Let's say we want to solve for the eigen-values of a symmetric matrix of size $n$ x $n$. In the Phase 1 of the computation, the matrix is reduced to a tridigonal form using Householder/Arnoldi's ...
4
votes
2answers
115 views

matrix storage, many rows or many columns?

tl;dr Should I store a matrix of Nx3 elements row-wise or column-wise, if I'm going to access 3 elements at a time? Does it matter? I'm setting up a numerical simulation with matrices of x,y,z ...
1
vote
2answers
106 views

Finding rate of convergence by curve fitting in Matlab

I have some data: number of nodes $N$ and error in energy norm corresponing to it. I have seen in some references that the rate of convergence is reported by $$\| u-u_h\| _E=CN^{\alpha} $$ How can ...
0
votes
2answers
70 views

Matlab Vectorization of columns in a 2D matrix and single element multiplication

MATLAB. I am trying to vectorize a loop in which each column vector of a 2D matrix (n-by-n) is found by multiplying each single element in a diagonal matrix with a column vector in another n-by-n 2D ...
2
votes
0answers
48 views

How can I use ODE events in MATLAB? [closed]

I need to have a better understanding about how to define ODE events. What I know is that if I have my ODE defined as ...
1
vote
1answer
140 views

Solving DAE with higher index

I want to solve 7 coupled differential equations in MATLAB. I used the method of lines (MOL) to convert them to a system of DAEs. I then attempted to solve this system using ode15s. Unfortunately an ...
0
votes
0answers
42 views

How to model softening of concrete?

I have a question about acquiring the softening part of the compressive stress-stain curve of concrete under uniaxial static loading. I have tried very different options: Concrete Damaged Plasticity ...
0
votes
0answers
77 views

Computing solutions with singularities using MATLAB ODE45

I am new to solving numerically ODES and thus it is difficult for me to judge the reliability/trustworthiness of the results that I have produced for the following problem: I am dealing with a 2nd ...
1
vote
2answers
109 views

How can one describe the accuracy of a Runge-Kutta method?

I am solving a nonlinear ODE with a regular singularity using MATLAB ODE45 or ODE113. I am wondering what precision and accuracy they have and what one can say about the numerical error. The idea ...
2
votes
0answers
82 views

ODE events to switch between 5 equations (friction model)

I am modelling a 1 dof spring-mass-damper system with friction. As first attempt I modelled the friction according to the simple Coulomb model (figure A here ...
1
vote
1answer
48 views

Approximate function following interpolation (Matlab)

How do you approximate a function for interpolated points? I use the natural cubic spline to interpolate points as follows for n = 500 points: ...
2
votes
0answers
82 views

Solving constrained BVP, singular Jacobian

The boundary value problem is $$ \begin{cases} \dot{x}_i = \begin{cases} (0.5D^{-1}\psi)_i, \text{ if }(0.5D^{-1}\psi)_i \le 0 \\ 0 \text{, otherwise} \end{cases} \\ \dot{\psi} = 2\Sigma x \\ x(0) ...
1
vote
0answers
66 views

How do I make a plot representing a vector field?

The plot shows the force magnitude and direction at every point in the semicircle. In matlab or mathematica we can make plots only with magnitudes vs positions in 2D graph. But how do I make a plot ...
4
votes
2answers
106 views

Prescribe solution of a PDE at specific points

I am using MATLAB's PDE toolbox to solve the differential equation $-\nabla\cdot\left(c(x)\nabla u(x)\right) + a(x)u(x) = f(x)$ The particular problem in question is an electrostatic problem, but ...
1
vote
1answer
124 views

How can I solve coupled equations by the method of line(MOL)?

I want to solve 3 coupled PDEs equations. They depend on time, radius and length. I used the method of lines (MOL) and converted them to a system of ODEs in time. Now I want to solve them using ...
2
votes
0answers
23 views

Constructing 2 fold oversampled cosine basis in MATLAB

So I'm trying to construct a 2 fold oversampled cosine basis in MATLAB. I know how to construct the basis as a square matrix using the following command: ...
4
votes
1answer
88 views

Obtaining column vectors of pseudo-inverse of a matrix

I need to compute the pseudo-inverse of a very large rectangular dense matrix without any special structure or properties. I run out of memory/computing power and have no access to a large parallel ...
0
votes
1answer
91 views

How can i define algebraic equation in differential function in MATLAB?

I want to solve 7 pde's that are functions of time, radius(j) and length(i). I used the method of lines and converted them to a system of odes in time and it becomes something like this: ...