1
vote
0answers
27 views

implicit non-linear equations with complex variables

I am trying to understand a methodology for solving implicit non-linear equations with complex variables. I would like to solve for z1 below where z2 is known. Also both z1 and z2 are complex ...
0
votes
1answer
31 views

Anyone recognize this pattern? Plotting relationship between two parameters and their response.

First time asking a question here so hopefully I can provide enough information to you guys without explaining more than necessary. I'm doing some amateurish numerical analysis in MATLAB on some ...
2
votes
0answers
56 views

How to solve this complicated differential equation?

I need to know how to solve this complicated differential equation in $z$ either analytically or numerically : \begin{eqnarray} \frac{dx_1}{dz} &=& -ib_1x_1 - ikx_2 \\ \frac{dx_2}{dz} ...
0
votes
0answers
31 views

Solving solely continuous system of ode's with matlab

I'm working with the numerical integration of the system of differential equations, $\dot{x}=f(x)$ with the vectorfield, $f(x)$ being solely continuous. Examples of the systems which I'm working on ...
0
votes
0answers
37 views

Finding minimum of a distance function using matlab

I have a function for that I want to find the minimum. The function calculates the distance between two sets where a set is defined as matix of row vectors $ D = [ d_1, d_2, ..., d_n]$, $d_n$ is a $m ...
0
votes
0answers
14 views

recursive curve fitting to find specified parameters

need to find the best fit parameters to the equation that give results close to experimental values that i 've got.. my equations is alpha=L1*(K/D) f=tan(x+(atan(x./alpha)))-(L1/(x*L2)) through this ...
7
votes
1answer
96 views

Fast algorithm for approximating Eigenvalue distribution of large sparse matrix

I am interested in the eigenvalue distribution of a huge $2^{16}$x$2^{16}$ Hermitian sparse matrix with spectrum contained in $[-1,1]$. That is I don't need to know all eigenvalues exactly, but rather ...
0
votes
2answers
28 views

Numerical precision of product of probabilities (normal CDF)

I'm trying to calculate $\prod_k{p_k}$ where $p_k$ are (potentially) very high probabilities of independent, zero-mean, standard normal random variables and $k>100$. However, I'm running into ...
1
vote
1answer
97 views

Solving Differential Equations theoretically and using matlab

i am trying to solve the initial value and elliptic boundary value problems below. but now i need some help solving them using matlab. for the elliptic problem, any method is ok, but for the initial ...
0
votes
1answer
41 views

Plot as you go in MATLAB

I'm self studying some numerical analysis and I'd like to get a feel for how an ODE solver speed varies as you move forward in time. Is it possible to use matlab to numerically solve an equation ...
1
vote
0answers
32 views

Numerical solution of non-linear differential equation with MATLAB

I need some information to know if I can solve a nonlinear integral equation with terms $ u_{x} $ , $ u_{x}.u_{y} $ , $ u_{xx} $ , $ u_{xy} $ $u_{yy} $ $ u_{x}^{2} $ $ u_{y} ^{2} $ By numerical ...
0
votes
0answers
29 views

Errors in numericaly solving hyperbolic PDE in matlab

I am a beginner for PDE and I want to solve a hyperbolic PDE using matlab's builtin function hyperbolic(). However I am facing some erros and I could not resolve them. Can someone suggest or comment ...
4
votes
1answer
65 views

Due to numerical inaccuracy, the solution of a boundary value problems becomes negative

I treat a toy example to get my point across. In reality I have to deal with a much more complex model. Let us consider a one dimensional boundary value problem using the bvp5c solver in Matlab. Two ...
1
vote
0answers
13 views

efficiently solve for values of a coefficient in a function, so for those values, the function intersects another function a specific number of times.

This is my summer assignment for my freshman "Intro to Numerical Methods with Matlab: Unit 2" course. The task: "Write an efficient Matlab code, which will take any closed $f(x)$ and $g(x)$ and ...
1
vote
0answers
70 views

Numeric solution of third order ODE

I need to solve the following third order (non-linear) ODE by numerical methods: \begin{equation}\tag{1} h^{3} \dfrac{d^3 h}{d x^3} = h-1. \end{equation} By assumption, the solution should approach $ ...
1
vote
0answers
165 views

Change MATLAB code from Lax-Wendroff to Leapfrog

I want to see how leapfrog would look using this code, but I'm having issues implementing it. I think my biggest problem is adding in the $ U_j^{n-1}$ term, I just don't get the logic. Here's what ...
0
votes
2answers
41 views

Numerical Differentiation using Numerical Methods

I am currently studying Numerical Differentiation in MATLAB using Numerical Methods in Engineering with Matlab by Jaan Kiusalaas, and I am stuck at exercise 13 from Problem Set 5.1 from Chapter 5 ...
3
votes
0answers
52 views

The definition and meaning of “machine epsilon” in MATLAB

I am taking a introductory course in numerical mathematics, using MATLAB and a numerical math text that refers to MATLAB often. In the text, the machine precision is defined as: The distance ...
0
votes
1answer
30 views

What is wrong with this algorithm [closed]

Crout factorization: n=10 A = full(gallery('tridiag',n,-1,2,-1)) i = 2:(n-1); bmid = i.^2 / ((n+1).^4) b = [1+1/(n+1)^4, bmid, 6+(n^2)/(n+1)^4]' for i = 1:n L(i,1) = A(i,1) end for j = 1:n U(1,j) = ...
0
votes
1answer
38 views

Backward error for Crout factorization

Ok, can someone please tell me what is the formula for the max error in LU decomposition of Crout factorization?
0
votes
1answer
221 views

Gauss Seidel iteration in matlab

I've posted this question before for crout factorization. Now, I need help with Gauss-Seidel iteration. Write a program that takes a value for n and solves for x using the following method: ...
0
votes
1answer
39 views

How can I solve an ODE when $F(x_0)=F'(x_0)=0$ is given at an unknown point $x=x_0$ using bvp5c?

I'm attempting to solve the following ODE using MATLAB bvp5c. I've used bvp5c for other typical multipoint boundary value problems but I have no idea how to deal with ODEs with conditions given at an ...
2
votes
0answers
60 views

(newbie) spectral derivative

I have data that form a scalar field on a 2D grid, evenly spaced. The grid has a finite size. There is no particular periodicity patern in my data. I want to calculate the value of the gradient at ...
1
vote
1answer
117 views

Matlab ode45 numerical solution

I'm trying to solve a 2nd order differential equation, using the Runga Kutta's ode45 function in Matlab. It's for a bachelor project, where I'm trying to simulate the behavior of a spherical robot, ...
0
votes
0answers
46 views

A numerical inverse Fourier transform

I am doing an research in phase noise, And I'm troubled in a paper. In that paper,it says when perform a inverse Fourier transform on ...
0
votes
2answers
38 views

Ordinary differential equations with signed first derivative

Consider the following coupled set of ordinary diferential equations: \begin{align} (K_{pa}+K_r)y_1(t)-K_ry_2(t)+C_0\operatorname{sign}(\dot{y}_1(t))\lvert\dot{y}_1(t)\rvert^\alpha &= ...
1
vote
1answer
45 views

How to approximate a smooth function

Now I have a target smooth function f which is infinitely differentiable over $R^d$, $f \in C^{\inf}(R^d)$. $f = \Sigma c_ig_i(x)$, where $c_i$s are unknown coefficients and $g_i(x)$ is a smooth ...
0
votes
0answers
64 views

Matlab and Van der Pol

Trying to use ODE15s to solve Van der Pol Oscillator for mu=2. I am getting the following error: Warning: Failure at t=4.968128e+00. Unable to meet integration tolerances without reducing the step ...
0
votes
1answer
95 views

Interest Rate Tree in Matlab

I would like to calibrate a interest rate tree using the optimization tool in matlab. Need some guidance on doing it. The interest rate tree looks like this: How it works: 3.73% = 2.5%*exp(2*0.2) ...
0
votes
0answers
38 views

Best optimizer in Matlab for this problem?

I need to do yield curve extraction for fixed income. I have 10 fixed income instruments for which I have values. The method is called Nelson-Siegel Method: ...
1
vote
0answers
68 views

Calculate a 5x5 Vandermonde system for a 5 point mesh

This is problem 1.2 in Randall J Leveque's textbook, "Finite Di fference Methods for Ordinary and Partial Di fferential Equations". I'm struggling with how to actually do the computation, I'm not so ...
0
votes
0answers
27 views

Numerical problem with set of ODEs

I have a set of ODEs: $$\dot{x}_{i} = f_i(x_1, \ldots, x_N), ~ i \in \{1, 2, \ldots, N\}$$ This set of ODE has the following properties: $\displaystyle\sum_{i=1}^N f_i = 0 ~ \forall x_1, \ldots, ...
1
vote
0answers
157 views

How can I write a code for the continued fraction expansion of arctan in matlab using wallis' algorithm?

I have already written the following program using wallis' algorithm for continued fraction expansion, but when I compare it to the actual value of arctan the error is high. I thought that there was ...
0
votes
1answer
59 views

MATLAB: Approximate tomorrow's temperature with 2nd, 3rd and 4th polynomial using the Least Squares method.

The following is Exercise 3 of a Numerical Analysis task I have to do as part of my university course on the subject. Find an approximation of tomorrow's temperature based on the last 23 values ...
-1
votes
1answer
107 views

Solve nonlinear equations: variables with degree six and degree eight.

Suppose I have two nonlinear equations with two variables $\ell$ and $m$; the variables $\ell$ and $m$ are of degree eight in the first equation and of degree six in the second equation. How it ...
3
votes
1answer
634 views

How to compute elliptic integrals in MATLAB

I need to calculate the complete elliptic integrals of the first and second kind , the incomplete elliptic integral of the first kind, and the incomplete elliptic integral of the second kind in ...
0
votes
1answer
47 views

What is the best built-in optimizer in Matlab for this problem?

I need to optimize $$\sum_{j=1}^p\frac{\sigma^2 \alpha_j^2}{\sigma^2+\delta_j^2\alpha_j^2}-\frac{\left(\displaystyle\sum_{j=1}^p \displaystyle\frac{\sigma^2 ( \delta_j^2 \alpha^2 - ...
1
vote
1answer
150 views

Using Romberg integration with improper integral

I'm trying to write a MATLAB function that implements Romberg's method of integration. Problem is that I'm trying to approximate:$$\int_0^1\frac{\sin{x}}{x}dx$$ but the function is not defined at $x ...
0
votes
1answer
77 views

Numerical integration for integrals 7th order.

I need to calculate integral which looks like below, with some numerical method: ...
0
votes
2answers
335 views

finite difference method for nonlinear ode

I am trying to use finite difference method to solve $y'''+y^2y''-y'=0, y(0)=y'(0)=0, y''(1)=1$. I let $u=dy/dx$ so the new problem is $u''+y^2u'-u=0, u(0)=0, u'(1)=1,y=\int u$. To try and solve this ...
1
vote
1answer
105 views

Is implementation of method possible?

Can I implement the Jacobi and Gauss-Seidel method,at a matrix, even if its determinant equals to zero? I use Matlab and want to find the convergence of the method for the Hilbert matrix. I wanted to ...
0
votes
0answers
36 views

Numerical Solvers to deal simultaneously with very different types of Oscillatory Behaviour

I am trying to solve these two related problems numerically: \begin{align} &f^{(\mbox{v})}(y) -(f^5 (y))'-\frac{1}{6}yf(y)=0\\ f'(0)=f'''(0)=0, &\quad f(y) \sim Cy^{(-1/7)}\exp(\gamma ...
2
votes
0answers
173 views

Runge-Kutta method accuracy

I got Runge-Kutta method here and I solve this system using it. So here's Runge-Kutta stuff $k_1 = f(t_n, y_n)$ $k_2 = f(t_n + h/2, y_n + hk_1/2) $ $k_3 = f(t_n+h, y_n - hk_1 + 2hk_2)$ $y_{n+1} ...
1
vote
1answer
326 views

Writing a MATLAB .m File to Generate a Plot of Absolute Error as a Function of h (step-size)

This is the question I am to solve: Given the function $f(x)=\ln(3x+1)$, compute approximations to $f'(0)$ using the centered 3-point formula: $f'(x_0)\approx\frac{f(x_0+h)-f(x_0-h)}{2h}$. ...
0
votes
1answer
24 views

element wise matrix operation problem

I am doing an element wise power calculation, and at a given point, I get a complex value out of real values! I have attached a screen shot from the debugging mode in Matlab So, one can see that the ...
-1
votes
2answers
338 views

Accurate Numerical Integration for unequally spaced data

I need to calculate numerical integration of unequally spaced data accurately. For equally spaced data, richardson extrapolation on romberg integral works quite well. ...
0
votes
1answer
322 views

MATLAB. Secant Method test.

Test the secant method on an example in which $r$, $f'(r)$ and $f''(r)$ are known in advance. Monitor the ratios $e_{n+1}/(e_n e_{n-1})$ to see whether they converge to $- \frac{1}{2} f"(r) / f'(r)$. ...
0
votes
0answers
524 views

Finite difference approximation of heat equation with source term

I am using the implicit finite difference method to discretize the 1-D transient heat diffusion equation for solid spherical and cylindrical shapes. The general equation is: $$ ...
1
vote
0answers
139 views

Matlab.Compute $f(x) = \sin(x) + \cos(x)-1$

Write a procedure to compute $f(x) = \sin(x) + \cos(x) - 1$ The routine should produce nearly full machine precision for all $x$ in the interval $[0, \frac{\pi}{4}]$ Hint: $\sin^2 \theta = ...
0
votes
1answer
426 views

Matlab fast summation

I was wondering whether there is a faster way to evaluate this double sum in matlab: $$\sum_{n=1}^{\text{max}} \sum_{m=-n}^{n} f(n,m).$$ Cause I am currently doing this with a foor loop over n and m ...