Answered
Iteration over initial condition in ode45
e = [0.4,0.5,0.6,0.7,0.8,0.9]; Pg = [3,4,5]; tistart = 500; tEnd = 7200; CDF_in = 0; for i = 1:numel(e) for j = 1:nume...

3 years ago | 0

Answered
min F(S_1,S_2,):1.25 S_1^2+0.4S_2^2 Min ʄ (S_1,S_2,S_3 ): S_1^2+0.35S_2^2 2S_1^2+0.6S_2^2≤5100000 5S_1^2+3S_2^2 ≤14250000
My guess is you want to maximize, not minimize the objective function. The result of mimimizing it is obviously s_1 = s_2 = 0 in...

3 years ago | 0

| accepted

Answered
Array indices must be positive integers or logical values.
I don't get this error message (see above). But you should rename the result from det(A) - otherwise you have "overwritten" the ...

3 years ago | 0

Answered
Why I'm getting empty values for the unknowns [a0, a1, a2, b0, b1, b2] using solve function?
u = [73.430, 9.522, 491.183, 569.351, 577.275].'; v = [730.723, 1311.200, 1286.046, 676.560, 1868.456].'; x_n = [88, 26, 503, ...

3 years ago | 1

| accepted

Answered
interpolateSolution for a system of time dependent PDEs
For a time-dependent solution, you must additionally specify the index of the output time for which you want to interpolate: ui...

3 years ago | 0

| accepted

Answered
Projection of Ax on By where norm(x)=norm(y)=1 and A,B are matrices.
The projection of A*x on B*y is dot(A*x,B*y)/dot(B*y,B*y)*B*y I don't know where you want norm = 1 come into play here.

3 years ago | 1

Answered
Problem in using ddesd for a simple DDE with one dependent variable and two delay terms.
sol = ddesd( @ddefun, @delay, @history, [ 0, 1 ] ); t = sol.x; x = sol.y; plot(t, x); xlabel('t'); ylabel('x(t)'); title('...

3 years ago | 1

| accepted

Answered
How do you plot markers to specific points?
The points in the graph you address are x(1), x(5), x(9) and x(15), not x=1, x=5, x=9 and x=15. Use "find" before plotting to g...

3 years ago | 1

Answered
Can I include an ODE when I solve a system of PDEs in pdepe
No, but this code should work for your purpose: https://de.mathworks.com/matlabcentral/fileexchange/97437-pde1dm?tab=reviews

3 years ago | 0

| accepted

Answered
solving a multivariate equation (4 equations, 4 variables) for n rows data using loop
syms Aprim0 Bprim0 Xmid Ymid R real syms Xup Xdown Yup Ydown % Define system of equations eqn1 = Yup - Aprim0*Xup - Bprim0 =...

3 years ago | 0

| accepted

Answered
How to make a tridiagonal matrix (N-1)*(N-1), with different values in the first row?
Change the two values manually after you created A with the "standard" diagonal vectors. A = ...; A(1,1) = A(1,1) + 4/3; A(1,...

3 years ago | 0

Answered
Sparse matrix x = A/B
Don't post pictures, post your code in plain ascii so that we are able to copy and execute it. Your A in the picture you posted...

3 years ago | 0

Answered
Why bvp4/5c produces anomalous solution when using parameter passing using anonymous functions ?
Works for me. With each call to bvp5c, the options structure has to be modified because e changes within the loop. e = 1; so...

3 years ago | 0

| accepted

Answered
When I run my code, I keep getting this error: "The following error occurred converting from sym to double: Unable to convert expression into double array."
So you have a constant source term int^1_0(y'*x)dx in all grid points - independent of the position x in the interval [0 1] ? ...

3 years ago | 1

Answered
Error while running "lsqcurvefit" function. "Failure in initial objective function evaluation. LSQCURVEFIT cannot continue."
Before calling lsqcurvefit, try to evaluate your function by fun(c0,xdata) and see what you get. If this evaluation is not pos...

3 years ago | 1

Answered
Removing vertical lines in a piecewise function when discontinuty points are not known
Maybe something like this. But the jump height of 0.05 at discontinuities most probably has to be adjusted in other applications...

3 years ago | 1

| accepted

Answered
Implicit system of ODEs, problem with ode15i
You can explicitly solve for yp - so there is no need to use ode15i. But the Gamma-problem remains. clc; clear all; close all ...

3 years ago | 0

Answered
Is there a way to take integrals over changing variables? Matlab
As far as I can see from the plots, we get the same results. syms p0 x b zeta real % Calculate lift distribution pz(x) pz = p...

3 years ago | 0

Answered
Problem using lsqnonlin with a simulink model
Did you study this example: https://de.mathworks.com/help/optim/ug/lsqnonlin-with-a-simulink-model.html ?

3 years ago | 0

| accepted

Answered
Solving exact ODE and fplotting a solution curve.
Why do you think sol(1) in your code above gives a trivial solution ? Is y(x) = -exp(x) trivial ? syms y(x) ode = (exp(x + y)...

3 years ago | 0

| accepted

Answered
how does fmincon interior-point algorithm deals wtih underdetermined system?
All optimization problems are "underdetermined" in the sense of what you wrote above (i.e. less equality constraints than unknow...

3 years ago | 0

| accepted

Answered
remove negative values from one column and the corresponding data in another coloumn
t = linspace(0,1); x = -1+2*rand(size(t)); idx = x<=0; x(idx) = []; t(idx) = []; size(t) size(x)

3 years ago | 1

Answered
How can I save one of variable in my function ?
After ode45 has finished, just recalculate NOD1 in the calling program for the time vector t: [t,x]=ode45(@odeHar,tspan,x0); ...

3 years ago | 2

| accepted

Answered
Definition of the error function in lsqnonlin
Use a function instead of a function handle. p0 = [1 2]; x = 0:1/10000:10 p = lsqnonlin(@(p)fun(p,x), p0); function err = ...

3 years ago | 0

| accepted

Answered
I don't know how to make a loop to my System ( System of coupled differential equation) with a heaviside step or square wave ?
ico=10; Vapp=0.6; V_T=1; V_m=.05; la=19.83; Ra=297.5; Rb=1457; Rs=8; Cm=1.2e-8; t_K=la/Ra; t_m=Cm*Rb; T = []; X = ...

3 years ago | 1

| accepted

Answered
one error i can not solve plz solve it.
If you check the sizes of vs.' and 1j*2*pi*f_mod*t size(vs.') size(1j*2*pi*f_mod*t) you will see that multiplication...

3 years ago | 0

Answered
Solving a complicated system of ODEs
You use dydt(5) and dydt(6) before they have been assigned their values: dydt(1) = -dydt(5) - k.*theta1; dydt(2) = -k....

3 years ago | 1

Answered
Trying to plot 2 variable 3d graph. The z matrix is filled with NaN values only.
TMR = (f_m*(f_Cd*sqrt(2*(f_dP_factor*p_c)/f_d)))./(o_m*(o_Cd*sqrt(2*(o_dP_factor*p_c)/o_d))); instead of TMR = (f_m*(f_Cd*sqrt...

3 years ago | 0

Answered
How to find the maximum value of two variables of a function in MATLAB
eta = 0.01:0.01:1; x0 = (1:1:100).'; z = 1e6*log2(1+(10^(30/10)*4*(3e8/(4*pi*1e12))^2*15^(-4)*exp(-0.0016*15))/10^(-90/10))*(-...

3 years ago | 0

Answered
Updating of boundary condition during bvp4c solution procedure
In bvp4c, your boundary conditions at xl = xstart and xr = xend can take the form fl(xl,psil) = 0 and fr(xr,psir) = 0 where fl a...

3 years ago | 0

| accepted

Load more