Answered

How can I solve a system of partial differential equations?

Use a first-order difference quotient to discretize dT_f/dz in space and use ODE15S to solve the resulting system of ordinary di...

How can I solve a system of partial differential equations?

Use a first-order difference quotient to discretize dT_f/dz in space and use ODE15S to solve the resulting system of ordinary di...

4 mois ago | 0

Answered

how to generate random point inside a sphere

R = 3; % radius of the sphere Xc = 4; Yc = -4; Zc = pi; % (Xc,Yc,Zc) center of the sphere rval = 2*rand(1)-1; elevation...

how to generate random point inside a sphere

R = 3; % radius of the sphere Xc = 4; Yc = -4; Zc = pi; % (Xc,Yc,Zc) center of the sphere rval = 2*rand(1)-1; elevation...

4 mois ago | 0

Answered

How to find the name of a function for a known value?

Textedit the code and search for the string '0.98'.

How to find the name of a function for a known value?

Textedit the code and search for the string '0.98'.

4 mois ago | 0

| accepted

Answered

SpecifyCoefficients for a specific PDE

https://de.mathworks.com/help/pde/examples/heat-distribution-in-a-circular-cylindrical-rod.html

SpecifyCoefficients for a specific PDE

https://de.mathworks.com/help/pde/examples/heat-distribution-in-a-circular-cylindrical-rod.html

4 mois ago | 0

| accepted

Answered

R2 approximation error as in Excel

https://de.mathworks.com/help/stats/coefficient-of-determination-r-squared.html

R2 approximation error as in Excel

https://de.mathworks.com/help/stats/coefficient-of-determination-r-squared.html

4 mois ago | 0

Answered

Creating new matrix from the second column of other matrices

new_matrix = [PIV_1(:,2),PIV_2(:,2),...,PIV_10918(:,2)] Quite much to write ... You should have worked with one 10918x1000x4 ...

Creating new matrix from the second column of other matrices

new_matrix = [PIV_1(:,2),PIV_2(:,2),...,PIV_10918(:,2)] Quite much to write ... You should have worked with one 10918x1000x4 ...

4 mois ago | 0

Answered

Generate Independent Identically and Lognormally Distributed Random Variables

Note that mu and sigma you supply for "lognrnd" are not mean and standard deviation of the underlying lognormal distribution, bu...

Generate Independent Identically and Lognormally Distributed Random Variables

Note that mu and sigma you supply for "lognrnd" are not mean and standard deviation of the underlying lognormal distribution, bu...

4 mois ago | 0

| accepted

Answered

Why do I get the error “Dimensions of arrays being concatenated are not consistent.”?

T = [ cos(d), -sin(d)*cos(b), sin(d)*sin(b), a*cos(d); sin(d), cos(d)*cos(b), -cos(d)*sin(b), a*sin(d); 0, sin(b),...

Why do I get the error “Dimensions of arrays being concatenated are not consistent.”?

T = [ cos(d), -sin(d)*cos(b), sin(d)*sin(b), a*cos(d); sin(d), cos(d)*cos(b), -cos(d)*sin(b), a*sin(d); 0, sin(b),...

4 mois ago | 0

| accepted

Answered

Generating random variable from certain standard deviation and mean

n = 100; x = 0.3*randn(n,1) generates 100 normally distributed random numbers with mean 0 and standard deviation 0.3.

Generating random variable from certain standard deviation and mean

n = 100; x = 0.3*randn(n,1) generates 100 normally distributed random numbers with mean 0 and standard deviation 0.3.

4 mois ago | 1

Answered

How to compute numerical gradient of an unknown function in matlab Simulink?

The i'th component gi of the gradient vector g is approximately given by gi = (f(x1,...,xi+h,...,x10)-f(x1,...,xi,...,x10))/h ...

How to compute numerical gradient of an unknown function in matlab Simulink?

The i'th component gi of the gradient vector g is approximately given by gi = (f(x1,...,xi+h,...,x10)-f(x1,...,xi,...,x10))/h ...

4 mois ago | 0

Answered

Having Trouble Using For-Loop Over Distributed Range with ODE45

delta1 = @(t) (t<=1200) delta0 = @(t) (t>1200) ODE = @(t,x,gamma,psi,beta) [delta1(t)*(-gamma)*x(1) + delta0(t)*psi*x(1); beta...

Having Trouble Using For-Loop Over Distributed Range with ODE45

delta1 = @(t) (t<=1200) delta0 = @(t) (t>1200) ODE = @(t,x,gamma,psi,beta) [delta1(t)*(-gamma)*x(1) + delta0(t)*psi*x(1); beta...

4 mois ago | 3

| accepted

Answered

Substitution of initial numerical values before odefunction

Use "matlabFunction" to convert every symbolic input to ODE45 into numerical function handles before calling ODE45.

Substitution of initial numerical values before odefunction

Use "matlabFunction" to convert every symbolic input to ODE45 into numerical function handles before calling ODE45.

4 mois ago | 0

| accepted

Answered

How do I maximise Volume of a cylinder such that its Surface Area is less than 10 using fmincon by predicting only either radius or height but not both?

Not possible. Since r and h are interdependent, "fmincon" must be able to vary both and thus predict them simultaneously. Of co...

How do I maximise Volume of a cylinder such that its Surface Area is less than 10 using fmincon by predicting only either radius or height but not both?

Not possible. Since r and h are interdependent, "fmincon" must be able to vary both and thus predict them simultaneously. Of co...

4 mois ago | 0

| accepted

Answered

this code is for calculating the probability of attack success represent for the equation A, i need to change it to calculate the probability of attack success for the equation B:where q =[0.1 ,0.2 , 0.3, 0.4 , 0.5] and p= 1-q and Z= 6

function main q1a = [0.1 0.2 0.3 0.4 0.5]; q2a = [0.1 0.2 0.3 0.4 0.5]; z = 6; vec = zeros(1,z); for i = 1:numel(...

this code is for calculating the probability of attack success represent for the equation A, i need to change it to calculate the probability of attack success for the equation B:where q =[0.1 ,0.2 , 0.3, 0.4 , 0.5] and p= 1-q and Z= 6

function main q1a = [0.1 0.2 0.3 0.4 0.5]; q2a = [0.1 0.2 0.3 0.4 0.5]; z = 6; vec = zeros(1,z); for i = 1:numel(...

4 mois ago | 0

| accepted

Answered

How to fix "Index exceeds the number of array elements (1)"?

for i=1:length(L) psi0= psi(i); L0 = L(i); To=[cosd(psi0) sind(psi0) 0; -sind(psi0) cosd(psi0) 0; 0 0 1]; Tg=[To ze...

How to fix "Index exceeds the number of array elements (1)"?

for i=1:length(L) psi0= psi(i); L0 = L(i); To=[cosd(psi0) sind(psi0) 0; -sind(psi0) cosd(psi0) 0; 0 0 1]; Tg=[To ze...

4 mois ago | 1

Answered

How to fit multivariable equation?

coeffs = [inputs, ones(size(inputs,1),1)] \ outputs

How to fit multivariable equation?

coeffs = [inputs, ones(size(inputs,1),1)] \ outputs

4 mois ago | 0

Answered

I need help in this question please?

y(t) = sum_{i=0}^{Inf} a_i*t^i y'(t) = sum_{i=1}^{Inf} i*a_i*t^(i-1) y''(t) = sum_{i=2}^(Inf} i*(i-1)*a_i*t^(i-2) Set y''(t)+...

I need help in this question please?

y(t) = sum_{i=0}^{Inf} a_i*t^i y'(t) = sum_{i=1}^{Inf} i*a_i*t^(i-1) y''(t) = sum_{i=2}^(Inf} i*(i-1)*a_i*t^(i-2) Set y''(t)+...

4 mois ago | 0

Answered

How to calculate the (odd ,even) condition in the following Poisson distribution for p_z parameter? i need some help in the code bellow

function main p1 = 0.9; p2 = 0.8; q1 = 1-p1; q2 = 1-p2; z = 6; vec = zeros(1,z); vec(1:2:end) = q1/p1; v...

How to calculate the (odd ,even) condition in the following Poisson distribution for p_z parameter? i need some help in the code bellow

function main p1 = 0.9; p2 = 0.8; q1 = 1-p1; q2 = 1-p2; z = 6; vec = zeros(1,z); vec(1:2:end) = q1/p1; v...

4 mois ago | 1

Answered

Lagrange Interpolating Polynomials using Matlab

You must use a fitting tool, not an interpolation tool to solve your problem. Apply "polyfit" with x-values = Generation Output...

Lagrange Interpolating Polynomials using Matlab

You must use a fitting tool, not an interpolation tool to solve your problem. Apply "polyfit" with x-values = Generation Output...

4 mois ago | 0

| accepted

Answered

CDF of rain rate

https://stackoverflow.com/questions/36385036/how-to-make-a-cdf-from-a-histogram-in-matlab

CDF of rain rate

https://stackoverflow.com/questions/36385036/how-to-make-a-cdf-from-a-histogram-in-matlab

4 mois ago | 0

Answered

How to define a variable as an integer that's equal to or greater than zero?

rest = mod(struct_idx,4); if rest == 1 ... elseif rest == 2 ... elseif rest == 3 ... elseif rest == 0 ... end

How to define a variable as an integer that's equal to or greater than zero?

rest = mod(struct_idx,4); if rest == 1 ... elseif rest == 2 ... elseif rest == 3 ... elseif rest == 0 ... end

4 mois ago | 0

| accepted

Answered

Matlab code for delay differential equations

https://de.mathworks.com/help/matlab/delay-differential-equations.html

Matlab code for delay differential equations

https://de.mathworks.com/help/matlab/delay-differential-equations.html

4 mois ago | 1

| accepted

Answered

How to solve this equation which contains complex number, bessel equation and its derivative?

x0 = [2; 1]; fun = @(x)[real(1i*besselj(1,complex(x(1),x(2)))-complex(x(1),x(2)).*(besselj(0,complex(x(1),x(2)))-besselj(2,...

How to solve this equation which contains complex number, bessel equation and its derivative?

x0 = [2; 1]; fun = @(x)[real(1i*besselj(1,complex(x(1),x(2)))-complex(x(1),x(2)).*(besselj(0,complex(x(1),x(2)))-besselj(2,...

4 mois ago | 1

Answered

Finite difference method - solving boundary conditions

y1(1) - 1.0 = 0 (y1(i+1)-2*y1(i)+y1(i-1))/dx^2 - (2*(y1(i+1)-y1(i-1))/(2*dx)/(1-x(i)) + y1(i)/(x(i)^2*(1-x(i))^2)*(y1(i)^2-1+(y...

Finite difference method - solving boundary conditions

y1(1) - 1.0 = 0 (y1(i+1)-2*y1(i)+y1(i-1))/dx^2 - (2*(y1(i+1)-y1(i-1))/(2*dx)/(1-x(i)) + y1(i)/(x(i)^2*(1-x(i))^2)*(y1(i)^2-1+(y...

4 mois ago | 0

| accepted

Answered

How to enforce ode15s to solve a DAEs system with some state variables limited by a range?

The solution of your problem is uniquely determined by the equations you impose - you can't impose any further conditions on the...

How to enforce ode15s to solve a DAEs system with some state variables limited by a range?

The solution of your problem is uniquely determined by the equations you impose - you can't impose any further conditions on the...

4 mois ago | 0

| accepted

Answered

Solving boundary value problem for nonlinear differential equation using method of collocation - Gauss sites

Up to my experience, the FORTRAN code "colnew" and "colsys" developed by Ascher are still the best bvp solvers available. Searc...

Solving boundary value problem for nonlinear differential equation using method of collocation - Gauss sites

Up to my experience, the FORTRAN code "colnew" and "colsys" developed by Ascher are still the best bvp solvers available. Searc...

4 mois ago | 0

| accepted

Answered

How to solve a set of DAEs with multiple dependent differential variables

The Euler equations are not thus easy to solve. You should consult a book on numerical methods for the equations of gas dynamic...

How to solve a set of DAEs with multiple dependent differential variables

The Euler equations are not thus easy to solve. You should consult a book on numerical methods for the equations of gas dynamic...

4 mois ago | 0

Answered

Boundary condition in non-linear ODE

function du = ode4(eta,u) theta = u(1); Sr = u(2); % beta dtheta = u(3); % d(theta)/dr ...

Boundary condition in non-linear ODE

function du = ode4(eta,u) theta = u(1); Sr = u(2); % beta dtheta = u(3); % d(theta)/dr ...

4 mois ago | 1

| accepted

Answered

How can I create a loop for this equation?

L = cumsum(demand); L = L./(1:numel(L)); L = L(4:12)

How can I create a loop for this equation?

L = cumsum(demand); L = L./(1:numel(L)); L = L(4:12)

4 mois ago | 1

Answered

How to solve a non-linear system of difference equations ?

Call "fsolve" repeatedly to get (S3,K2,E2), (S4,K3,E3), ... (S(t+2),K(t+1),E(t+1)) A(t) = A(1)*(1+a)^(t-1) is obvious.

How to solve a non-linear system of difference equations ?

Call "fsolve" repeatedly to get (S3,K2,E2), (S4,K3,E3), ... (S(t+2),K(t+1),E(t+1)) A(t) = A(1)*(1+a)^(t-1) is obvious.

4 mois ago | 0