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...

ongeveer 14 uur 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 ...

6 dagen 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...

6 dagen 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. ...

6 dagen 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. ...

7 dagen 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...

7 dagen 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)

8 dagen ago | 0

| 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...

8 dagen 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 ...

9 dagen 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 ...

9 dagen 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')

10 dagen 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)

13 dagen 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 - ...

13 dagen 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.

14 dagen 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

14 dagen ago | 0

Answered

How to solve an equation, with infinite solutions, to find only n number of solutions?

fun = @(x)cos(x)*cosh(x)-1; Interval = zeros(4,2); Interval(1,:) = [3/2*pi, 3/2*pi+0.5]; Interval(2,:) = [5/2*pi, 5/2...

How to solve an equation, with infinite solutions, to find only n number of solutions?

fun = @(x)cos(x)*cosh(x)-1; Interval = zeros(4,2); Interval(1,:) = [3/2*pi, 3/2*pi+0.5]; Interval(2,:) = [5/2*pi, 5/2...

14 dagen ago | 0

| accepted

Answered

Unbound Shear Layer boundary condition problem

function main xlow = -1; xhigh = 1; A = 1; solinit = bvpinit(linspace(xlow,xhigh,4000),[1,1],1); sol = bvp4c(@bvp4o...

Unbound Shear Layer boundary condition problem

function main xlow = -1; xhigh = 1; A = 1; solinit = bvpinit(linspace(xlow,xhigh,4000),[1,1],1); sol = bvp4c(@bvp4o...

14 dagen ago | 2

| accepted

Answered

What wrong in line 12 ?? help me please (Index exceeds matrix dimensions.)

clear close all; N = 10; h = 0.5; u1(1) = 2 ; u2(1) = 3 ; u3(1) = 0 ; t = 0:h:N*h; for n = 1:N u3(n+1) = u1(n)+h*u2(...

What wrong in line 12 ?? help me please (Index exceeds matrix dimensions.)

clear close all; N = 10; h = 0.5; u1(1) = 2 ; u2(1) = 3 ; u3(1) = 0 ; t = 0:h:N*h; for n = 1:N u3(n+1) = u1(n)+h*u2(...

15 dagen ago | 0

Answered

Plotting the solution of multi-variable non-linear equations (solved using fsolve).

function main G = linspace(250,750).'; X0 = [1,1,1,1]; for i=1:numel(G) sol = fsolve(@(X)ptfunc(X,G(i)),X0); ...

Plotting the solution of multi-variable non-linear equations (solved using fsolve).

function main G = linspace(250,750).'; X0 = [1,1,1,1]; for i=1:numel(G) sol = fsolve(@(X)ptfunc(X,G(i)),X0); ...

16 dagen ago | 0

| accepted

Answered

Problems with integral in fsolve

function main z_0 = [0.5,3,4]; options = optimset('TolFun',1e-8,'TolX',1e-8); sol = fminsearch(@fun,z_0,options) end ...

Problems with integral in fsolve

function main z_0 = [0.5,3,4]; options = optimset('TolFun',1e-8,'TolX',1e-8); sol = fminsearch(@fun,z_0,options) end ...

16 dagen ago | 0

Answered

How to take input from a function file in optimization toolbox objective?

x = fmincon(@objective,x0,A,b) function f = objective(x) % Calculate phi and lambda from x f = -phi*inv(lambda)*phi'; end

How to take input from a function file in optimization toolbox objective?

x = fmincon(@objective,x0,A,b) function f = objective(x) % Calculate phi and lambda from x f = -phi*inv(lambda)*phi'; end

16 dagen ago | 0

| accepted

Answered

Generalized extreme value distribution Parameter Estimation

https://de.mathworks.com/help/stats/gevfit.html

Generalized extreme value distribution Parameter Estimation

https://de.mathworks.com/help/stats/gevfit.html

17 dagen ago | 0

Answered

Unable to find explicit solution

The message says that your differential equation is too complicated to get an explicit expression as solution. Try a numerical ...

Unable to find explicit solution

The message says that your differential equation is too complicated to get an explicit expression as solution. Try a numerical ...

17 dagen ago | 0

Answered

Failure in initial user-supplied objective function evaluation

Try abc = @fun1; x0 = [0,0]; f = abc(x0); and see what is returned in f.

Failure in initial user-supplied objective function evaluation

Try abc = @fun1; x0 = [0,0]; f = abc(x0); and see what is returned in f.

17 dagen ago | 0

Answered

Using ode45 for transient analysis

First possibility: Use the end time of integration big enough such that the water temperature surely exceeds the one you prescr...

Using ode45 for transient analysis

First possibility: Use the end time of integration big enough such that the water temperature surely exceeds the one you prescr...

17 dagen ago | 2

| accepted

Answered

Why is the output of my function infinity?

Since your function tends to 0 as x -> 0 by L'Hospital, you can integrate y = cos((pi*cos(x))/2).^2.*csc(x).*(x > 0);

Why is the output of my function infinity?

Since your function tends to 0 as x -> 0 by L'Hospital, you can integrate y = cos((pi*cos(x))/2).^2.*csc(x).*(x > 0);

17 dagen ago | 0

Answered

Probability of at least 1 even number using while loop

Maybe of interest for checking the result of the Monte Carlo simulation: P(rolling at least one even number with 3 dice) = 1- ...

Probability of at least 1 even number using while loop

Maybe of interest for checking the result of the Monte Carlo simulation: P(rolling at least one even number with 3 dice) = 1- ...

17 dagen ago | 0

Answered

Multiple linear equality constraints in fmincon

Aeq = [1 0 1 0 ; 0 1 0 1 ; 1 1 0 0 ; 0 0 1 1]; beq = [sum of column 1 ; sum of column 2 ; sum of row 1 ; sum of row 2] X = [X1...

Multiple linear equality constraints in fmincon

Aeq = [1 0 1 0 ; 0 1 0 1 ; 1 1 0 0 ; 0 0 1 1]; beq = [sum of column 1 ; sum of column 2 ; sum of row 1 ; sum of row 2] X = [X1...

21 dagen ago | 1

| accepted