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

2 mois 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)

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

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

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

2 mois 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')

2 mois 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)

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

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

2 mois ago | 0

Answered
How is "feasibility" defined in fmincon?
https://de.mathworks.com/matlabcentral/answers/77808-understanding-output-of-fmincon-optimization-using-sqp-algorithm

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

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

2 mois 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(...

2 mois 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); ...

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

2 mois 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

2 mois ago | 0

| accepted

Answered
Generalized extreme value distribution Parameter Estimation
https://de.mathworks.com/help/stats/gevfit.html

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

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

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

2 mois 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);

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

2 mois ago | 0

Answered
How to find a corresponding matrix value
[M I] = min(t); y(I)

3 mois ago | 0

| accepted

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

3 mois ago | 1

| accepted

Answered
Trying to start optimization problem (minimization) with constraints
Setting cJ= c/(2*J) and kJ = k/J, you arrive at theta(t) = exp(-cJ*t)*(1.309*cJ/sqrt(kJ-cJ^2)*sin(t*sqrt(kJ-cJ^2)) + 1.309*cos(...

3 mois ago | 0

Answered
How to Solve Second Order ODE with 1 boundary condition for y and 1 non-zero boundary condition for y'
If you convert your second order equation to a system of first-order equations y1' = y2 y2' = -a*y1 you can use bvp4c to set ...

3 mois ago | 1

| accepted

Answered
how to write matlab code
N=20:50 A = setdiff(N,N(mod(N,4)==0 & mod(N,5)==0))

3 mois ago | 0

Answered
Partial Differential Equation Toolbox
Take c = [- x, x - y ; - ( x - y ), - y] Then -div(c*grad(u)) = x * d^2u/dx^2 + y * d^2u/dy^2 Section 2-62 in http://www....

3 mois ago | 1

| accepted

Answered
Solving for two uknown vectors in a matrix equation
syms t1 t2 s1 s2 s3 [solt1 solt2 sols1 sols2 sols3] = solve([N*[t1;t2]+R*[s1;s2;s3] == x],[t1 t2 s1 s2 s3])

3 mois ago | 0

Answered
Question about Taylor series
d(1) = cos(a), d(2) = -sin(a), d(3) = -cos(a), d(4) = sin(a) So your if-statement to determine f^(n)(a) is wrong. Further, "er...

3 mois ago | 0

Load more