Answered
How to fix the error in pdepe?
I included the commands size(c) size(f) size(s) at the end of your function pdex2pde. You can see that MATLAB doesn't lie:...

2 years ago | 0

| accepted

Answered
assume can't constrain vpasolve
vpasolve is a numerical solver - symbolic commands like "assume" are not respected. But you can set ranges for the variables in ...

2 years ago | 2

| accepted

Answered
Unable to meet integration tolerances
I reduced Pr_water by a factor of 0.6 to achieve convergence. % Constants Pr_air = 0.7; Pr_water = 6.7*0.6; eta_end = 4; % A...

2 years ago | 0

| accepted

Answered
Need help substituting vector variables into symbolic expression
syms x w1 b1 l1 = tanh(x * w1 + b1); b1_actual = zeros(1,10); w1_actual = rand(1,10); l1_actual = arrayfun(@(i)subs(l1,[w1,b...

2 years ago | 0

Answered
How to modify the matrix - rows and columns?
A1 = reshape(A(:,1),116,227) A2 = reshape(A(:,2),116,227) A3 = reshape(A(:,3),116,227)

2 years ago | 0

| accepted

Answered
how to get function value at any input, after solving Differential eq. using dsolve
syms t y(t) Z= dsolve(diff(y,t)==1+t^2,y(1)==-4) Z_at_2 = subs(Z,t,2) Z_at_2_numeric = double(Z_at_2) fplot(Z,[-2 2]) grid ...

2 years ago | 1

| accepted

Answered
Solving non linear equations
Each of the 16 quadruples (T1(i),T2(i),T3(i),T4(i)) (i = 1,...,16) constitutes a solution for your system of equations. You mus...

2 years ago | 1

| accepted

Answered
Soling a boundary value problem
Prove the following: If u is a solution of your differential equation, so is c*u for every c in IR. So it does not surprise th...

2 years ago | 0

Answered
The fastest method to perform sum of function
I tried precomputing the output of your function symbolically and then evaluate it for numerical input. But it seems there is no...

2 years ago | 0

Answered
Can help me to correct the code for calculation for given condition of por_cr
por_cr= 0.22; por = [0.1,0.2,0.3,0.5,0.34,0.12,0.1]'; Gt = [20,21,21,28,23,25,14]'; Kt = [32,33,31,28,33,29,34]'; Pe = [14,...

2 years ago | 0

| accepted

Answered
What could be the reason for this fzero error and how to solve it ?
Use "fsolve" instead of "fzero": aa = fsolve(fun,xx0)

2 years ago | 1

Answered
How to solve an equation with big matrix?
Looks like a generalized eigenvalue problem of the form (A - w^2*B)*x = 0 with unknown x and w. Use "eig" to solve it.

2 years ago | 0

| accepted

Answered
solving set of equations using iteration
% Initial guess T_mf0 = 60; T_mp0 = 30; % Call solver x = fsolve(@fun,[T_mf0,T_mp0]); %Output result T_mf = x(1) T_mp = x...

2 years ago | 0

Answered
Two-variable optimization with additional conditions
Use "fmincon" and set the condition as a constraint in function "nonlcon". Since you work with trigonometric functions, maybe r...

2 years ago | 0

| accepted

Answered
Understanding the error in matlab code for the given double summation
The summation prod = prod+prod_1; must be inside the loop over jj, not outside as you coded it.

2 years ago | 0

Answered
pde1dm compared to pdepe
I wonder about the differences between these two algorithms in the spatial discretization? No difference. pde1dm has the option...

2 years ago | 1

Answered
Improper integral at 0
Your integrand behaves like x^(-12/5) at x=0. That means that the value of the integral is + Inf. lambda = 0.07; mu_1 = 0.05; ...

2 years ago | 0

Answered
My program keeps freezing after about 7 iterations of newtons method. The code exponentially slows down
Turn the df(xi) into double(df(xi)) to avoid symbolic expressions that blow up with each iteration. syms x func01 =@(x) x.^2-1...

2 years ago | 0

| accepted

Answered
Computation of distance of a set of points from a fitting curve (of 2n grade like a parabola).
Use "polyval" to compute the polynomial values p at the flow rates f of the "black points". The distance is then abs(p-Head Lo...

2 years ago | 0

Answered
The approximation of the ln(1.9) using the Taylor series ln(1-x) = -sum of x^k/k, -1 less than or equal to x less than 1, I can't figure out how to code this properly
x = 0.9; compare_value = log(1+x); k = 0; value = 0; error = 1e-10; while abs(value-compare_value) > error k = k + 1; ...

2 years ago | 0

Answered
Which algorithm does SVD function take?
https://uk.mathworks.com/matlabcentral/answers/748667-what-is-the-algorithm-used-by-svd-function

2 years ago | 1

Answered
How to make one matrix?
Either use a cell array or dimension the matrix to have the maximum number of columns of the 100 row vectors: A = [1 23 45]; B...

2 years ago | 1

| accepted

Answered
Logarithmically space a vector
Maybe you mean numFilts=32; CenterFreqs = logspace(log10(50), log10(8000), numFilts) plot(1:32,CenterFreqs)

2 years ago | 0

| accepted

Answered
How to save data in for comend when cubic equation need to be solved
t = 293:303; for i = 1:numel(t)%Temperature range T = t(i); Mm=0.01;%Input SA=1;%Input UnSA=1;%Input T1=1/298;%The rever...

2 years ago | 1

| accepted

Answered
System of equations with ode45
Errors are due to initial conditions? Not only. The code must look somehow like this: N = 10; M = zeros(2*N); M(1,1) = 1; M...

2 years ago | 0

Answered
Help me figure out what the error is. This is the first time I use matlab. Optimization problem with thirteen variables.
x0 = zeros(13,1); lb = zeros(13,1); ub = inf(13,1); sol = fmincon(@fun1_optim,x0,[],[],[],[],lb,ub) fun1_optim(sol) functio...

2 years ago | 1

Answered
geometric rv code user defined function
t=0:10; p=0.95; f=geometric_rv(t, p) z=pdf('Geo', t, p) figure; plot(f); hold on; stem(z); legend('User-define...

2 years ago | 0

Answered
Can someone helps me to solve the error in this code?
You mean ia = (10^-7)*(exp(-(Eexc/R)*((1/T)-(1/298)))); ic = (10^-3)*(exp(-(Eexc/R)*((1/T)-(1/353)))); instead of ia = (10^...

2 years ago | 0

Answered
Circular dependency in function and optimization problem
Define r as a third optimization variable and use the nonlinear constraint function "nonlcon" as function profit = optmprob(x) ...

2 years ago | 0

| accepted

Answered
How can I simplify a very complicated derivative (when using simplify does not help much)?
You can try nsteps = 100; simplified_dPi_dgamma = simplify(dPi_dgamma,'Steps',nsteps)

2 years ago | 0

Load more