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

mehr als 2 Jahre vor | 2

| akzeptiert

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

Beantwortet
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)

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 1

| akzeptiert

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

mehr als 2 Jahre vor | 1

| akzeptiert

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

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 1

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 1

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

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 1

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

mehr als 2 Jahre vor | 1

| akzeptiert

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 1

| akzeptiert

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

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 1

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

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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)

mehr als 2 Jahre vor | 0

Beantwortet
Setting 'ReturnCondition' to true when attempting to use solve results in "Unable to find explicit solution"
Rewriting your equation gives the following result. It may happen that the squaring on both sides gives additional solutions tha...

mehr als 2 Jahre vor | 0

| akzeptiert

Mehr laden