Answered

Probability distribution of a multiple variable sum

Take samples from your empirical data and use Monte-Carlo-simulation to determine the above probability. This code should help ...

Probability distribution of a multiple variable sum

Take samples from your empirical data and use Monte-Carlo-simulation to determine the above probability. This code should help ...

12 dagen ago | 1

| accepted

Answered

How can we provide minimum distance i.e. 20 between each random generated node?

I think Jan Simon's answer will at least partially solve your problem: https://de.mathworks.com/matlabcentral/answers/142322-fi...

How can we provide minimum distance i.e. 20 between each random generated node?

I think Jan Simon's answer will at least partially solve your problem: https://de.mathworks.com/matlabcentral/answers/142322-fi...

13 dagen ago | 1

Answered

Optimization problem with a function of 2 parameters

TC = @(x) (QC(x(1))+FC(x(2))+ RC)/E(x(2)); lb = [1.5e-5,1000]; ub = [2.5e-5,100000]; sol = fmincon(TC,[2e-5,10000],[],[],[],[...

Optimization problem with a function of 2 parameters

TC = @(x) (QC(x(1))+FC(x(2))+ RC)/E(x(2)); lb = [1.5e-5,1000]; ub = [2.5e-5,100000]; sol = fmincon(TC,[2e-5,10000],[],[],[],[...

13 dagen ago | 0

| accepted

Answered

Solve a system of equations

x22 - w0 = x13 = x31 * x32 = x22 * x21 / (x22+k2*V2) * x22 = x22 * (x22/(x22+k1*V1)) / (x22+k2*V2) * x22 This gives a quad...

Solve a system of equations

x22 - w0 = x13 = x31 * x32 = x22 * x21 / (x22+k2*V2) * x22 = x22 * (x22/(x22+k1*V1)) / (x22+k2*V2) * x22 This gives a quad...

13 dagen ago | 0

| accepted

Answered

Can anyone help me in coding matlab code for Quadratically Constrained Quadratic Program (QCQP)?

function main H = [2 0 0;0 2 0;0 0 2]; f = [-1; -2 ;-3]; R = [7 0 0;0 7 0;0 0 7]; h = [-4 ;-5 ;-6]; c = 88; ...

Can anyone help me in coding matlab code for Quadratically Constrained Quadratic Program (QCQP)?

function main H = [2 0 0;0 2 0;0 0 2]; f = [-1; -2 ;-3]; R = [7 0 0;0 7 0;0 0 7]; h = [-4 ;-5 ;-6]; c = 88; ...

13 dagen ago | 0

Answered

Solving two nonlinear equations

A = 0.5:0.01:2; alpha = 0.5; l00 = 1; for i = 1:numel(A) a = A(i); fun = @(l0) 1 + alpha*l0^(alpha-1) - l0 - alpha*a*(2...

Solving two nonlinear equations

A = 0.5:0.01:2; alpha = 0.5; l00 = 1; for i = 1:numel(A) a = A(i); fun = @(l0) 1 + alpha*l0^(alpha-1) - l0 - alpha*a*(2...

16 dagen ago | 1

| accepted

Answered

How to plot a nonlinear equation using FSOLVE in MATLAB

K = 1:627; kp = 4500; h = 1.0e-3; d = 7.5e-3; ky0 = 1.0; Ky = zeros(numel(K),1); %fKy = zeros(numel(K),1); for i = 1:nume...

How to plot a nonlinear equation using FSOLVE in MATLAB

K = 1:627; kp = 4500; h = 1.0e-3; d = 7.5e-3; ky0 = 1.0; Ky = zeros(numel(K),1); %fKy = zeros(numel(K),1); for i = 1:nume...

16 dagen ago | 0

Answered

function of integral bound

function main sol = fzero(@fun,1.0) end function res = fun(b) amin = 0; amax = b; xmin = 0; xmax = @(a) a+b...

function of integral bound

function main sol = fzero(@fun,1.0) end function res = fun(b) amin = 0; amax = b; xmin = 0; xmax = @(a) a+b...

20 dagen ago | 0

| accepted

Answered

How to redefine a variable inside the function?

Add the nonlinear constraint x(3) - x31*x32 = 0 in function "nonlcon". And remove the lines y33=x31*x32; x13=y33; % It shou...

How to redefine a variable inside the function?

Add the nonlinear constraint x(3) - x31*x32 = 0 in function "nonlcon". And remove the lines y33=x31*x32; x13=y33; % It shou...

22 dagen ago | 0

| accepted

Answered

A for loop need help ASAP

for i = 0:3:300 j = i/3 + 1; Fi(j)= atan(-(A5(1,1+i)/A5(1,2+i))); Theta(j) = acos(A5(1,3+i)); Psi(j)= atan(A3(1,3+i)...

A for loop need help ASAP

for i = 0:3:300 j = i/3 + 1; Fi(j)= atan(-(A5(1,1+i)/A5(1,2+i))); Theta(j) = acos(A5(1,3+i)); Psi(j)= atan(A3(1,3+i)...

23 dagen ago | 0

Answered

Solving system of ODE with dataset of variables

[t,Ts]=ode45(@(t,Ts)Temp_EH(t,Ts,time,Qin,Qout,Tin,rad,Tair,Vol_hip,Vol_ep,H_ep,AreaThermo,eair,f,dens,Cp,sigma,A,RL,eee,c1,Tran...

Solving system of ODE with dataset of variables

[t,Ts]=ode45(@(t,Ts)Temp_EH(t,Ts,time,Qin,Qout,Tin,rad,Tair,Vol_hip,Vol_ep,H_ep,AreaThermo,eair,f,dens,Cp,sigma,A,RL,eee,c1,Tran...

24 dagen ago | 1

| accepted

Answered

error in fmincon code

V0 = [1;2;4]; objective = @(V)[-s.',(l-q).']*V; But why do you shoot with canons on sparrows (means: why do you use a nonlinea...

error in fmincon code

V0 = [1;2;4]; objective = @(V)[-s.',(l-q).']*V; But why do you shoot with canons on sparrows (means: why do you use a nonlinea...

28 dagen ago | 0

| accepted

Answered

How can i find the distance between every point in two different point-clouds

https://de.mathworks.com/help/stats/pdist2.html min (D) or min (D.') seems to be what you are looking for.

How can i find the distance between every point in two different point-clouds

https://de.mathworks.com/help/stats/pdist2.html min (D) or min (D.') seems to be what you are looking for.

28 dagen ago | 1

Answered

complex solutions in ode23s

I guess there exist some operation in the calculation of your time derivatives that gives a complex result (e.g. sqrt of a negat...

complex solutions in ode23s

I guess there exist some operation in the calculation of your time derivatives that gives a complex result (e.g. sqrt of a negat...

29 dagen ago | 0

| accepted

Answered

Cannot get the right coefficient from PCHIP fit

From the documentation: Since the polynomial coefficients in coefs are local coefficients for each interval, you must subtract ...

Cannot get the right coefficient from PCHIP fit

From the documentation: Since the polynomial coefficients in coefs are local coefficients for each interval, you must subtract ...

ongeveer een maand ago | 0

| accepted

Answered

Could anyone help me to solve the issue.

If "initial_position" is an array with 5 elements and "common_position" is a scalar, you can simply type difference = common_po...

Could anyone help me to solve the issue.

If "initial_position" is an array with 5 elements and "common_position" is a scalar, you can simply type difference = common_po...

ongeveer een maand ago | 0

Answered

Fitting a straight line to a set of 3-D points

What I would do is find the average P¯of your points and an eigenvector V of the covariance matrix for its largest eigenvalue. ...

Fitting a straight line to a set of 3-D points

What I would do is find the average P¯of your points and an eigenvector V of the covariance matrix for its largest eigenvalue. ...

ongeveer een maand ago | 0

Answered

optimizing linprog 2 variables with different dimensions

Set V = [V(1) V(2) V(3)] = [z y(1) y(2)] as "combined" solution vector and write all your equations in V instead of z and y. ...

optimizing linprog 2 variables with different dimensions

Set V = [V(1) V(2) V(3)] = [z y(1) y(2)] as "combined" solution vector and write all your equations in V instead of z and y. ...

ongeveer een maand ago | 0

| accepted

Answered

fmincon or linprog use in minimization?

l = 0.25; q = 2; s = 1; A = 1; x = 20; d = 15; f= [-s, l-q]; Aeq = [1, A]; beq = x; lb = [0, 0]; ub = [Inf, d]; sol...

fmincon or linprog use in minimization?

l = 0.25; q = 2; s = 1; A = 1; x = 20; d = 15; f= [-s, l-q]; Aeq = [1, A]; beq = x; lb = [0, 0]; ub = [Inf, d]; sol...

ongeveer een maand ago | 0

| accepted

Answered

how can I plot a summation correctly?

n = 10; k = 0:n; S = cumsum(1./(k.^2+1)); plot(k,S)

how can I plot a summation correctly?

n = 10; k = 0:n; S = cumsum(1./(k.^2+1)); plot(k,S)

ongeveer een maand ago | 1

| accepted

Answered

Linear Programming With geq constraints

You will have to invert the signs of all the elements in A and b. And call linprog as xopt = linprog(z,A,b,[],[],lb) And I do...

Linear Programming With geq constraints

You will have to invert the signs of all the elements in A and b. And call linprog as xopt = linprog(z,A,b,[],[],lb) And I do...

ongeveer een maand ago | 0

Answered

Optimization of Plug Flow Reactor by Varying Temperature and Pressure

Although I guess that there are bounds on P and T, here is a code that will give you a start. In case you want to constrain P ...

Optimization of Plug Flow Reactor by Varying Temperature and Pressure

Although I guess that there are bounds on P and T, here is a code that will give you a start. In case you want to constrain P ...

ongeveer een maand ago | 1

| accepted

Answered

How to solve equation with elliptic integral for modulous?

Solve a_eq*sqrt(P1/B) = ellipticK(k1^2) - ellipticF(arcsin[ sin{(alpha + pi )/2}/k1],k1^2) for k1. Once you have k1, you can ...

How to solve equation with elliptic integral for modulous?

Solve a_eq*sqrt(P1/B) = ellipticK(k1^2) - ellipticF(arcsin[ sin{(alpha + pi )/2}/k1],k1^2) for k1. Once you have k1, you can ...

ongeveer een maand ago | 0

| accepted

Answered

Using dde23 with events option

plot(sol.x,sol.y(1,:),'k') hold on plot(sol.x,sol.y(2,:),'b') hold on plot(sol.x,sol.y(3,:),'r')

Using dde23 with events option

plot(sol.x,sol.y(1,:),'k') hold on plot(sol.x,sol.y(2,:),'b') hold on plot(sol.x,sol.y(3,:),'r')

ongeveer een maand ago | 1

| accepted

Answered

Using (x-a) ^ 2 + (y-b) ^ 2 = r ^ 2, the values of a, b and r are known. How do I find x and y values?

theta = linspace(0,2*pi,100); x = a + r*cos(theta); y = b + r*sin(theta); plot(x,y)

Using (x-a) ^ 2 + (y-b) ^ 2 = r ^ 2, the values of a, b and r are known. How do I find x and y values?

theta = linspace(0,2*pi,100); x = a + r*cos(theta); y = b + r*sin(theta); plot(x,y)

ongeveer een maand ago | 0

Answered

How to solve unique positive root

d(1) = 0.95; e(1) = 0.65; interest = 0.05; y = 0.02; r = 0.37; alpha = ((interest - ...

How to solve unique positive root

d(1) = 0.95; e(1) = 0.65; interest = 0.05; y = 0.02; r = 0.37; alpha = ((interest - ...

ongeveer een maand ago | 0

Answered

Matlab code of this equation

Use "pdepe" to solve the system u_t = u_xx + v v_t = u_xx Best wishes Torsten.

Matlab code of this equation

Use "pdepe" to solve the system u_t = u_xx + v v_t = u_xx Best wishes Torsten.

ongeveer een maand ago | 0

Answered

How is "feasibility" defined in fmincon?

https://de.mathworks.com/matlabcentral/answers/77808-understanding-output-of-fmincon-optimization-using-sqp-algorithm

How is "feasibility" defined in fmincon?

https://de.mathworks.com/matlabcentral/answers/77808-understanding-output-of-fmincon-optimization-using-sqp-algorithm

ongeveer een maand ago | 0