Answered
fmincon - penalty function
As far as I can see, you could formulate your problem as min: sum_i (abs(demand(i)-P(i))) s.c. Pmin <= P(i) <= Pmax 0 <= V_l...

4 years ago | 0

| accepted

Answered
The exponential integral (expint) of x is defined as E1, then how E2 is defined ? Can it be solved using MATLAB?
Why do you ask the same question again ? It has been answered here: https://de.mathworks.com/matlabcentral/answers/1665879-how...

4 years ago | 0

| accepted

Answered
decic error in DAEs which the equtions contain the difference scheme of state variables
The delta expressions are not acceptable since the ODE solver you chose varies stepsize in each integration step. You will have...

4 years ago | 0

| accepted

Answered
Optimization running. Error running optimization. Your fitness function must return a scalar value.
I can't decipher from function "opt" what you are trying to minimize. But anyhow: your c has dimension 1x8, but it has to be 1x...

4 years ago | 0

Answered
Polynomial fit with centering & scaling
Another option: xy = [ 1508.936 19.2189 1509.159 54.27226 1509.472 102.8022 ...

4 years ago | 0

Answered
How to generate correct sine wave
fs = 500; t = 0:1/fs:1-1/fs; x = sin(2*pi*10*t); plot(t,x) Better ?

4 years ago | 0

Answered
Unrecognized function or variable 'A'. Error in ode89vsrk (line 37) plot (t,A,x,Y(:,1))
%% ODE89 A0=1; B0=3; P0=0; K=5*10^-5; Yb=1; Yp=0.15; xM = [0 43200]; fyt = @(t,y,K,Yb,Yp) [(-K*y(1)*y(2)); (-Y...

4 years ago | 1

| accepted

Answered
how to find the correct value of the matrix
into = zeros(10,1); into(1:3)=x(1:3)*d(1); into(4:7)=x(4:7)*d(1); into(8:10)=x(8:10)*d(1); or simply into = x*d(1); You ca...

4 years ago | 0

Answered
Polynomial fit with centering & scaling
Here is an example that shows how to proceed: x = [1,2,3]; y = [4,9,25]; order = 1; p = polyfit(x,y,order); [p1,S,mu] = p...

4 years ago | 0

Answered
finding variables in polynomial expressions
A = [0 -83.33; 500 -10]; B = [166.67; 0]; C = [0 1]; K = @(k1,k2)[k1 k2]; A2 = @(k1,k2,ke) [A-B*K(k1,k2) B*ke; -C 0]; a ...

4 years ago | 0

Answered
solve a system of nonlinear equations + partial derivatives
I would like to solve a system of nonlinear equations which contains equations with partial derivatives If you evaluate dr/dx, ...

4 years ago | 0

Answered
How to define a variable as a condition of other variables
dTSI = r^2*SBC*4*T^3*dT/L^2 dT = dTSI*L^2/(r^2*SBC*4*T^3) dT/dTSI = L^2/(r^2*SBC*4*T^3) Thus in MATLAB: r = ...; SBC = ...;...

4 years ago | 0

| accepted

Answered
how to get the contour/shape of a representation in 2D?
https://de.mathworks.com/help/matlab/ref/convhull.html [k,~] = convhull(P); plot(P(k,1),P(k,2)) with P being your points as a...

4 years ago | 0

Answered
Slice (Or contour) 3D function (in polar coordinate) transformed into cartesian coordinate
https://de.mathworks.com/matlabcentral/answers/95796-how-do-i-create-a-contour-plot-in-polar-coordinates

4 years ago | 0

| accepted

Answered
Which solver should I use to solve a square and symmetric, linear system of equations?
R = chol(A); x = R\(R'\b) I don't know if it's faster than the usual \.

4 years ago | 0

Answered
Finding the perimeter of a 2D ellipse using composite trapezoidal integration
The arclength of a curve in parametrized form C = ((f1(t),f2(t)) ,a<=t<=b) is given as integral_{a}^{b} sqrt(f1'(t)^2+f2'(t)^2...

4 years ago | 0

| accepted

Answered
Help needed for below error
Since it seems that you only solve for a single unknown, change x2 = [0 1.73]; to x2 = 1.73; Then your code should be for ...

4 years ago | 0

Answered
How to write cumulative product function
m = 10; v = [1 1 2:m]; pcum = cumproduct(v) function pcum = cumproduct(v) n = numel(v); pcum = zeros(n,1); pcum(1)...

4 years ago | 0

| accepted

Answered
How would you solve the Pohlhausen solution for Pr=1 using Runge Kutta "RK" once values of the "f" function have been found from the Blasius solution like my code below?
for i = 1:N k1(i,:) = [f(i,2); f(i,3); -(f(i,1)*f(i,3))/2; f(i,5); -Pr/2*f(i,1)*f(i,5)]; k2(i,:) = [f...

4 years ago | 0

| accepted

Answered
How to use fmincon to minimize a function with equations and experimental data
In my opinion, you should reconsider your approach completely. For suggested values for A_WE and A_EW from the optimizer, you c...

4 years ago | 0

Answered
Accessing estimated parameters from nlinfit for weighted regression
Use "lsqnonlin" and define the functions f_i as f_i = (ydata_i - F(beta,xdata_i))/sigma(beta,xdata_i) "lsqnonlin" is the solve...

4 years ago | 0

| accepted

Answered
How to solve: Error using symengine 'Unable to convert expression containing symbolic variables into double array.'
vf=fz/dpi*Z_total*N; vc=2*ri*pi*N/1000; p00=0.01949; p10=0.5988; p01=-0.0001006; p20=-4.164; p11=4.871e-05; p02=-2.923e-0...

4 years ago | 1

| accepted

Answered
why am I recieving the error - Unexpected output of PDEFUN. For this problem PDEFUN must return three column vectors of length 2. ?
function [pl,ql,pr,qr] = pdebc(xl,ul,xr,ur,t); % Boundary Conditions pl = [0;0]; ql = [1;1]; pr = [0;0]; qr = [1;1]; end i...

4 years ago | 0

| accepted

Answered
Solving an equation with different inputs
n = 2.4; ALPHA = 0:0.01:0.28; c0 = 1.0; for i = 1:numel(ALPHA) alpha = ALPHA(i); f = @(c) alpha +(1-c).^n - c*n.*(1...

4 years ago | 0

| accepted

Answered
License Manager Error -96
https://de.mathworks.com/matlabcentral/answers/95122-why-do-i-get-license-manager-error-96

4 years ago | 0

Answered
How to create angle projection on matrix, for this case matrix dimension (16x32)
You mean PF = exp(1I*angle(A)); ? If not, please give a link to a site where it is explained so that we can understand.

4 years ago | 0

| accepted

Answered
How to solve this ode equation where one of the inputs has some delay and equation has written in matrix form in MATLAB ode45?
Order the complete list of time instances when the control variables change their values. If these times are 0 < t1 < t2 < t3 <...

4 years ago | 1

| accepted

Answered
How can i graph these equations?
https://de.mathworks.com/help/matlab/ref/fimplicit3.html

4 years ago | 0

Answered
Solving Differential Equations With
fe=2; Qsie=0.05; me=32000; ce=2*Qsie*(2*pi*fe)*me; ke=me*(2*pi*fe)^2; [t,x] = ode45(@(t,x)SMD(t,x,me,ce,ke,tt,Ft),[0 Tmax],...

4 years ago | 1

Answered
I want to comapre my A,B and P against time and want to compare my ODE89 function with Eulers method with a timestep of 3600
A1 = 1; B1 = 3; P1 = 0; ti = 0; tf = 12*3600; Yb = 1; Yp = 0.15; K = 5*10^-5; h = 3600; timestep = [3600 1800 900 450 2...

4 years ago | 0

Load more