Answered
Extracting symbolic values from symbolic matrix
syms t q2(t) q3(t) a1 a2 n1 = [a1*q3(t);a2*sin(q2(t));0]; n1(2,1) % extract element (2,1) n1(2,:) % extract complete 2nd ...

3 years ago | 0

| accepted

Answered
Why du/dx obtained from excel and Matlab gives different results?
If the X grid is equidistant, dudx = gradient(U,X(2)-X(1))

3 years ago | 0

Answered
Desorption-Fixed bed- Initial conditions
Then set c0 = cFeed*ones(n,1) c0(1) = 0.0; q0 = qFeed*ones(n,1) as initial and boundary conditions of the desorption, if thi...

3 years ago | 0

| accepted

Answered
plot a function wit cos
f=(0:10); %f0=5*10^9; c=(3*10^8); t=5*10^9; w=2*pi*f; wt=w*t; k=(wt/c); z=(0.75:30); r12=0.29; %x=0.094*cos*(k*z); y=0...

3 years ago | 0

Answered
How to fix error in my DAE program?
The call to ode15s is incorrect: [t,y] = ode15s(@(t,y) reduced21(t,y,T_a),tspan,y0); instead of [t,y,ydot] = ode15s(@(t,y,ydo...

3 years ago | 0

Answered
How to generate matrix from iterations?
V1 =[0 20 60 80 100]; V2 =[20 60 80 100]; itermax = 10; for i = 1:numel(V1) v1 = V1(i); for j = 1:numel(V2) ...

3 years ago | 0

Answered
how could i plot x^2+(y-x^3/2)^2=1 ?
fun = @(x,y)x.^2+(y-x.^3/2).^2-1; fimplicit(fun)

3 years ago | 0

Answered
How to solve PDE with two regions
Yes. Choose "a" as a grid point for pdepe. Then you can solve your system as one partial differential equation for C_B by addin...

3 years ago | 0

Answered
Unable to meet the tolerance without using more than 1666 mesh points.
Seems to work (see above).

3 years ago | 0

| accepted

Answered
too many input arguments Fmincon
parametersV = fmincon(objFun,parametersV,[],[],[],[],[],[],[],options); instead of parametersV = fmincon(objFun,parametersV,[]...

3 years ago | 0

| accepted

Answered
The control parameters of MILP
Read about "options" under https://de.mathworks.com/help/optim/ug/intlinprog.html

3 years ago | 0

| accepted

Answered
Change the format of output answers of two variable in two equations
T_surf_Max = double(S.T_surf(1)) T_o_Max = double(S.T_o(1))

3 years ago | 0

| accepted

Answered
Solution of Fick's Second Law of Diffusion Equation
Then discretize d^2C/dx^2, d^2C/dy^2 and d^2C/dz^2 and use the method of lines to integrate dC(i,j,k)/dt = D*((C(i+1,j,k)-2*C(i...

3 years ago | 1

| accepted

Answered
Struggling to formulate ODEs in matlab for two point boundary value problem using bvp4c
To get a feeling for your system, I'd start with equation (7) and ode45 as integrator. Assume hydrostatic pressure at the inle...

3 years ago | 0

| accepted

Answered
How to break the infeasibility of solution for the function linprog?
[x,fval,exitflag,output] = linprog(___) if exitflag > 0 % linprog was successful take action 1 else % linp...

3 years ago | 2

| accepted

Answered
Minimization of two simultaneous ODES with shared parameters
https://de.mathworks.com/matlabcentral/answers/43439-monod-kinetics-and-curve-fitting

3 years ago | 0

| accepted

Answered
Error When Using ODE45 to solve symbolic ODE Equation : Too many input arguments.
s = 1; N_s = 3e15; V = 16.7; S = 4.6; tao_p = 3.6; tao_0 = 10e-13; v=4.82e20; R=8.31; T=295; Ed = 25; a = ((s*v*tao_0)...

3 years ago | 1

| accepted

Answered
I am unable to understand the error messages and correct the errors.Can anyone correct my code?
syms x y(x) E=207e9; P=1000; m=2; n=2; Ix=(pi/(1024*m^4))*(x^2-4*m*n)^4; I1x=diff(Ix); I2x=diff(I1x); eqn = diff(y,x,4) ...

3 years ago | 0

Answered
How can I plot a graph according to the results
clc clear %Newton method func = @(x,y) 10*x.^2 - 4*x.*y + 7*y.^2 - 4*sqrt(5)*(5*x-y) - 16 ; e = 0.01; i=0; n=0; b =...

3 years ago | 0

| accepted

Answered
I want to plot 100 graph for T vs abs(r) for different initial condition and therefore I wrote this code, but it doesn't plotting any graph please help mem in this code.
ti = 0; tf = 1E-8; tspan=[ti tf]; KC = 2E-6; hold on for j = 1:100 y0= [(1e-2)*rand(2,1); ((-3.14).*rand(1,1) + (3.14).*ra...

3 years ago | 0

| accepted

Answered
How to save a matrix into a number?
max2min = [ 4 3 2 1]; min2max = fliplr(max2min); max2min = str2double(sprintf('%d',max2min)); min2max = str2double(spri...

3 years ago | 1

Answered
converting equation into multiple of two matrix
https://de.mathworks.com/help/symbolic/sym.equationstomatrix.html

3 years ago | 0

| accepted

Answered
Inequality constraint cause infeasible results in NMPC
Your constraints say that a number should be >= -5000 (Min/Max constraint) and that it should be <= -5000 (U(2)+5000). That's ha...

3 years ago | 0

Answered
How do i solve differential equation 2nd oder simbolically and numerically?
syms t y(t) sigma(t) eqn_diff = diff(y,t,2)+3*diff(y,t)+y(t)-2*sigma(t)==0; ysol(t) = dsolve(eqn_diff); var = symvar(ysol) e...

3 years ago | 1

| accepted

Answered
How to solve method of lines on one-dimensional heat equation using Euler's method?
% Parameters k = 0.5; % Evaluate BC dx = 0.01; x = 0:dx:1; dt = 0.0001; t = 0:dt:0.5; h = 1/(length(x)-1) ; %step size ...

3 years ago | 0

| accepted

Answered
I need help to make graphs please
See above. I added four lines to your code to plot the results and changed the line flux(index)=fluxp+fluxe0+fluxe1+fluxe2; to...

3 years ago | 1

| accepted

Answered
The proper way to sample 3 normally or lognormal distributed variables added up to 1
You can define a common probability distribution of the three variables on the triangle x + y + z = 1, x, y, z >= 0 but this c...

3 years ago | 0

Answered
How can I constrcut this matrix for a problem?
If x = [x0,x1,...,xn] is an 1x(n+1) row vector, you could use M = zeros(n+1); for i = 1:n+1 M(i,:) = psi(x(1:n+1)-x(i)); ...

3 years ago | 0

| accepted

Answered
Are the algorithms used in mldivide direct solvers?
Are the algorithms used by "mldivide" for any input direct solvers (not matter if (not) sparse, (not) symmetric, (not) banded et...

3 years ago | 0

Answered
how to write an equation the it is function of itself (solar cell current equation)
I guess you want to solve for J ? Then define fun_J = @(J) J - (J_PH - J0*(exp(q*(V+J*R_S)/(k_B*T))-1)-(V+J*R_S)/R_SH) and u...

3 years ago | 0

Load more