Answered

Poisson Boltzmann eq. with an infinite boundary condition

Hi Roi For convenience I will use u in place of psi. An exact solution is tanh(u/4) = A*exp(-x) where A = tanh(1/4) ...

Poisson Boltzmann eq. with an infinite boundary condition

Hi Roi For convenience I will use u in place of psi. An exact solution is tanh(u/4) = A*exp(-x) where A = tanh(1/4) ...

5 days ago | 1

Answered

Can I use the PDEPE solver to solve the following dimensionless Transient PFR PDE? If not, what method do you reconmend?

Hello Rogelio, For psi(t,eta) I assume that the boundary conditions are psi(0,eta) = 0 for all eta an...

Can I use the PDEPE solver to solve the following dimensionless Transient PFR PDE? If not, what method do you reconmend?

Hello Rogelio, For psi(t,eta) I assume that the boundary conditions are psi(0,eta) = 0 for all eta an...

7 days ago | 0

Answered

double peaks in FFT matlab

Hello hamzah the fft is a complex function. Are you plotting only the real part? This problem is occurring because your delta...

double peaks in FFT matlab

Hello hamzah the fft is a complex function. Are you plotting only the real part? This problem is occurring because your delta...

10 days ago | 0

Answered

How to plot wavelength and wavenumber FFT from intensity data

Hi Arwi, n = 3648, dpix = 8e-9; % 8nm seems small for a pixel width The x array has spacing delx = dpix and is x = delx*(0:...

How to plot wavelength and wavenumber FFT from intensity data

Hi Arwi, n = 3648, dpix = 8e-9; % 8nm seems small for a pixel width The x array has spacing delx = dpix and is x = delx*(0:...

13 days ago | 0

Answered

Verifying the uncertainty principle with fft for Gaussian

Hello Ori, The problem stems from the following, where I am using t and f rather than x and k (see comment). For an fft, once ...

Verifying the uncertainty principle with fft for Gaussian

Hello Ori, The problem stems from the following, where I am using t and f rather than x and k (see comment). For an fft, once ...

14 days ago | 0

| accepted

Answered

why the Real and imaginary part of fourier transform (fft) are not zero for real odd function

Hi Jiali, with an even number of points the symmetry is not quite right. In the frequency domain, for eight points (without an...

why the Real and imaginary part of fourier transform (fft) are not zero for real odd function

Hi Jiali, with an even number of points the symmetry is not quite right. In the frequency domain, for eight points (without an...

15 days ago | 0

| accepted

Answered

How to solve Ax=B with some knowns in x and B

Hi Derek, the method below uses y instead of B so that A*x = y, and does not assume that the known values of x are contiguous t...

How to solve Ax=B with some knowns in x and B

Hi Derek, the method below uses y instead of B so that A*x = y, and does not assume that the known values of x are contiguous t...

16 days ago | 0

Answered

Convert permute and reshape to for

Hi Raquel, For loops are going to be slower, but it is interesting to seet how much and under what circumstances. The followin...

Convert permute and reshape to for

Hi Raquel, For loops are going to be slower, but it is interesting to seet how much and under what circumstances. The followin...

17 days ago | 0

| accepted

Answered

X axis for convoluted function

Hi dinesh, Here is an example with two normal (gaussian) pdfs. Arrays x and f(x) describe one of them, and arrays y and g(y) d...

X axis for convoluted function

Hi dinesh, Here is an example with two normal (gaussian) pdfs. Arrays x and f(x) describe one of them, and arrays y and g(y) d...

18 days ago | 0

Answered

¿Why the phase of the Fourier transform whith "angle" fuction of a rectangular pulse function is not odd?

Hi Paulina, neglecting some unimportant (in this context) real constants, the fourier transform of the square pulse is sin(w*t...

¿Why the phase of the Fourier transform whith "angle" fuction of a rectangular pulse function is not odd?

Hi Paulina, neglecting some unimportant (in this context) real constants, the fourier transform of the square pulse is sin(w*t...

20 days ago | 0

Answered

RF toolkit capacitance calculation

Hi Derek, The exact expression is indeed the acosh expression used in Matlab, and we would expect no less. The log expression ...

RF toolkit capacitance calculation

Hi Derek, The exact expression is indeed the acosh expression used in Matlab, and we would expect no less. The log expression ...

27 days ago | 0

| accepted

Answered

How to shuffle data at the same way EVERYTIME random.seed(42)

Hi RG rng(12345) % for example rand rand rng(12345) rand % same values as before rand see help rand for mor...

How to shuffle data at the same way EVERYTIME random.seed(42)

Hi RG rng(12345) % for example rand rand rng(12345) rand % same values as before rand see help rand for mor...

1 month ago | 0

Answered

Inaccuracy in a loglog(...) plot, compared to a standard plot(...)

HI Adam, I am assuming that you are doing something like x = [1 2] y = [2,3] plot(x,y) and then zooming in on the plot at, ...

Inaccuracy in a loglog(...) plot, compared to a standard plot(...)

HI Adam, I am assuming that you are doing something like x = [1 2] y = [2,3] plot(x,y) and then zooming in on the plot at, ...

1 month ago | 3

| accepted

Answered

I'm not getting antenna pattern roll off that I expect, not sure if I'm wrong or where there is 20, there should be 10?

Hi mike, since intensity goes as the square of the E field, the expression to use is 10*log10((cosd(70)^1.4)^2) ans = -1...

I'm not getting antenna pattern roll off that I expect, not sure if I'm wrong or where there is 20, there should be 10?

Hi mike, since intensity goes as the square of the E field, the expression to use is 10*log10((cosd(70)^1.4)^2) ans = -1...

1 month ago | 0

Answered

Surf(x, y, z) with a colormap that is only two colours

Hi Emil, x = linspace(-20,20,2400); fz = exp(-x.^2./0.2).*cos(5*x); [X, Y] = meshgrid(x, x); z = exp(-X.^2-Y.^2); f = z.*me...

Surf(x, y, z) with a colormap that is only two colours

Hi Emil, x = linspace(-20,20,2400); fz = exp(-x.^2./0.2).*cos(5*x); [X, Y] = meshgrid(x, x); z = exp(-X.^2-Y.^2); f = z.*me...

1 month ago | 0

| accepted

Answered

Fourier series of any function

Hello Danny, the problem is that you are supposed to approximate the function with a sum of sines and cosines with certain ampl...

Fourier series of any function

Hello Danny, the problem is that you are supposed to approximate the function with a sum of sines and cosines with certain ampl...

1 month ago | 0

| accepted

Answered

Order of integration in double integral

Hi A.K. If you are convinced that the problem arises from the square root singularity, one approach is a change of variable y ...

Order of integration in double integral

Hi A.K. If you are convinced that the problem arises from the square root singularity, one approach is a change of variable y ...

1 month ago | 0

Answered

How to integrate products of hypergeometric functions and rational functions?

Hello Nicolas, I don't know how you are implementing the nth derivative of 1/(lambda^2 + q^2) but it is obviously very time con...

How to integrate products of hypergeometric functions and rational functions?

Hello Nicolas, I don't know how you are implementing the nth derivative of 1/(lambda^2 + q^2) but it is obviously very time con...

1 month ago | 0

| accepted

Answered

Simplifying a complex function in order to separate real and imaginary part?

Hi zah ra, An explicit form for real and imaginary parts of (1 - r*exp(theta*1i))^(3/2) is possible, although not particularl...

Simplifying a complex function in order to separate real and imaginary part?

Hi zah ra, An explicit form for real and imaginary parts of (1 - r*exp(theta*1i))^(3/2) is possible, although not particularl...

2 months ago | 0

Answered

Steady-states and non-trivial eigenvalues of equation

Hi katara, the fixed points are at 0,theta,K as you said. Although you don't have specific values, the derivatives, which you ...

Steady-states and non-trivial eigenvalues of equation

Hi katara, the fixed points are at 0,theta,K as you said. Although you don't have specific values, the derivatives, which you ...

2 months ago | 0

Answered

Cannot use besselh as function handle

Hi wbriand, any reason you can't just define F = @(nu,z) besselh(nu,1,z) or F = @(nu,z) besselh(nu,2,z) whichever one you w...

Cannot use besselh as function handle

Hi wbriand, any reason you can't just define F = @(nu,z) besselh(nu,1,z) or F = @(nu,z) besselh(nu,2,z) whichever one you w...

2 months ago | 0

Answered

Scaling an array by a certain number so that the area under the curve equals a fixed number

HI Christina, A = trapz(x,pyy) % find the unscaled area pyy_new = pyy*(30/A); trapz(x,pyy_new) % this ...

Scaling an array by a certain number so that the area under the curve equals a fixed number

HI Christina, A = trapz(x,pyy) % find the unscaled area pyy_new = pyy*(30/A); trapz(x,pyy_new) % this ...

2 months ago | 0

Answered

ilaplace() function is giving wrong results

Hi David, plugging in cosh(z) = ((exp(z) + exp(-z))/2 sinh(z) = ((exp(z) - exp(-z))/2 results in a constant and two exponent...

ilaplace() function is giving wrong results

Hi David, plugging in cosh(z) = ((exp(z) + exp(-z))/2 sinh(z) = ((exp(z) - exp(-z))/2 results in a constant and two exponent...

2 months ago | 0

Answered

clamp cross-entropy loss

Hi Matt, z = log(Y); z(z<100) = 100; loss = -sum(W*(T.*z))/N; In the link you provided, they talk about a limit of -100 rath...

clamp cross-entropy loss

Hi Matt, z = log(Y); z(z<100) = 100; loss = -sum(W*(T.*z))/N; In the link you provided, they talk about a limit of -100 rath...

2 months ago | 0

| accepted

Answered

Vectorization time-varying recursive linear function

Hi Bruno, a = rand(1,50); b = rand(1,50); % method 1 xk = 0; x = zeros(1,50); for k = 1:50 xk = a(k)*xk + b(k); ...

Vectorization time-varying recursive linear function

Hi Bruno, a = rand(1,50); b = rand(1,50); % method 1 xk = 0; x = zeros(1,50); for k = 1:50 xk = a(k)*xk + b(k); ...

2 months ago | 0

| accepted

Answered

Laplace of heaviside function with negative arguments

Hi Darius, since the laplace transform is Integral{0,inf} f(t)*exp(-s*t) dt, the value of f(t) for t<0 makes no difference. ...

Laplace of heaviside function with negative arguments

Hi Darius, since the laplace transform is Integral{0,inf} f(t)*exp(-s*t) dt, the value of f(t) for t<0 makes no difference. ...

2 months ago | 0

Answered

Intersection line and quadrilateral

Hi Francesco Here is one way. The function linecross determines whether two line segments intersect. The function yesno just ...

Intersection line and quadrilateral

Hi Francesco Here is one way. The function linecross determines whether two line segments intersect. The function yesno just ...

2 months ago | 0

| accepted

Answered

How to find out the intersection points between two 3D ellipsoids?

Hi PA, As has been alluded to, the intersection of these two surfaces results in lines. These are calculated below. The abc c...

How to find out the intersection points between two 3D ellipsoids?

Hi PA, As has been alluded to, the intersection of these two surfaces results in lines. These are calculated below. The abc c...

2 months ago | 0

Answered

dot multiplication of the matrices is not the same when you feed the matrix and concatenate the matrix

Hi mohammed, For H1_2 you have switched a3 and a4 between the first calculation and the hand calculation. So you get two diffe...

dot multiplication of the matrices is not the same when you feed the matrix and concatenate the matrix

Hi mohammed, For H1_2 you have switched a3 and a4 between the first calculation and the hand calculation. So you get two diffe...

3 months ago | 0

Answered

About FFT of cosine function

Hi mk, In order to get just the two sharp peaks you need to have exactly n oscillations in the time domain. Otherwise the wave...

About FFT of cosine function

Hi mk, In order to get just the two sharp peaks you need to have exactly n oscillations in the time domain. Otherwise the wave...

3 months ago | 0

| accepted