Réponse apportée
Logarithmically space a vector
Maybe you mean numFilts=32; CenterFreqs = logspace(log10(50), log10(8000), numFilts) plot(1:32,CenterFreqs)

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 2 ans il y a | 0

Réponse apportée
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...

plus de 2 ans il y a | 1

Réponse apportée
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...

plus de 2 ans il y a | 0

Réponse apportée
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^...

plus de 2 ans il y a | 0

Réponse apportée
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) ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
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)

plus de 2 ans il y a | 0

Réponse apportée
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...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
non linear partial diferential equation
I don't see a similarity to the heat equation. You will have to discretize the left-hand side of the equation and use ode15s to...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
求助:编写程序求解积分方程中的参数k的值
gamma_wc = 0.38; t_ITZ = 40; D_c = 0.488; lambda = 1.08; fun = @(k) 125/(1+3.15*gamma_wc)-(125-t_ITZ)*D_c-integral(@(x)D_c*(...

plus de 2 ans il y a | 1

Réponse apportée
Algae growing. Concentration curve problem
Here is a code for a simple heat-conduction equation dT/dt = d^2T/dz^2 T(z,0) = 0 T(0,t) = 200 T(1,t) = 340 T(0.5,t) = 90 ...

plus de 2 ans il y a | 0

Réponse apportée
Usage of ode function
I assume you know r0=r(t=0) and v0=v(t=0). Then r = r0 + cumtrapz(t,(a.*F_yf - b.*F_yr)./I) v = v0 + cumtrapz(t,(F_yf+F_yr-m....

plus de 2 ans il y a | 0

Réponse apportée
How to solve the error "Error using sqpInterface Nonlinear constraint function is undefined at initial point. Fmincon cannot continue." Error occurred when calling NLP solver
Before calling "fmincon", call the constraint function with your initial vector. My guess is that it returns NaN or Inf for some...

plus de 2 ans il y a | 0

Réponse apportée
Passing out additions parameters after ODE solver.
sol = adsorptionSolver(t,z,yF,TPF) for i = 1:size(sol.y,2) [~,velocity(:,i)] = adsorptionModel(sol.x(i),sol.y(:,i),z(2)-z(...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Using bvp4c for coupled second order ODEs. Issue in calling bvp4c.
guess = bvpinit(y, uinit); y must be the spatial mesh, uinit must either be a function handle that returns a 4x1 vector of in...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
Saving an extra variable from PDEPE
After the computation with "pdepe" is completed, call "pdeval" to get the spatial derivatives of your solution on the x-mesh and...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
bvp5c:Unable to solve the collocation equations -- a singular Jacobian encountered
I get syms x1 x2 x3 x4 x5 x6 real syms D11 D12 D13 D22 D23 D33 real syms u l1 l2 l3 l4 l5 l6 f1 f2 f3 f4 f5 f6 h1 h2 h3 b1 b2...

plus de 2 ans il y a | 0

Réponse apportée
Unable to get the following DAE system of equations solved
The time derivative of the first equation is 1e45 at the beginning. Check your parameters and their units. %% DAE of solution ...

plus de 2 ans il y a | 0

Réponse apportée
How to solve Ax=b with some all knowns except some x values
This gives 2 equations in 1 unknown. You must be lucky if you get a value for # that satisfies both equations. In this case, it ...

plus de 2 ans il y a | 1

Réponse apportée
difficulty solving simulataneous equations
syms Ra Rb La Lb Va Vb iaD ibD ia ib eqns = [Lb*ibD - La*iaD + Rb*ib - Ra*ia + Vb == Va, iaD == -ibD] S = solve(eqns, [iaD,ib...

plus de 2 ans il y a | 0

Réponse apportée
Calculus Variational; code for finding the value of two constants for 2 values of the variable
I didn't check whether the Euler equation gives x(t) = 5*t^3/6 + c1*t + c2, but if this is the case, you can get c1 and c2 via ...

plus de 2 ans il y a | 0

Réponse apportée
fsolve not varying input variable
I included your code and inserted the line norm((fun(x0+[0 0 0 0 0 sqrt(eps)])-fun(x0))) before your call to "fsolve". sqrt(e...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
I should get a straight line graph in this equation after substituting initial conditions. I dont know where I am getting wrong. Can anyone help me with this?
For which solution variable do you expect a line as solution ? syms t y(t) Dy = diff(y,t); D2y = diff(y,t,2); m=1; k=1; c=...

plus de 2 ans il y a | 0

Réponse apportée
below are the codes to solve heat transfer using implicit and explicit method but my implicit method is showing huge error, what is wrong on the implicit method
Implicit scheme means: (ut(i,j+1)-ut(i,j))/dt = (ut(i-1,j+1)-2*ut(i,j+1)+ut(i+1,j+1))/dx^2 or ut(i,j+1)/dt - (ut(i-1,j+1)-2*...

plus de 2 ans il y a | 0

Réponse apportée
whether meshes affect computational step lengths in pdepe
Adaptive in x: no. Adaptive in t: yes. Thus the x-mesh affects computational accuracy, the t-mesh not. The accuracy in t is infl...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
calculate the perimeter of a polygon arranged in space
After reading the x/y data, sum up the lengths of the line segments that constitute the circumference: perimeter = 0; for i = ...

plus de 2 ans il y a | 0

Réponse apportée
Differential Equation - Integral Equation
syms r z k eqn = int((20-1.19e8*r^2)/(1.19e8*r^2),r,30e-6,40e-6)==int(0.54*8*1e-3/4e3,z,0,k); knum = solve(eqn,k) knum = doub...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
can anyone help me to get rid of the error not enough input arguments in line 7?
x0 = [10; 0]; Time_Span = [0, 40.0]; [t_ex2, x_ex2] = ode45(@ODE_Damped_Spring, Time_Span, x0); figure; plot(t_ex2, x_ex2(:...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Interpolation schemes that produce positive second derivatives of the interpolant
If you do function approximation (e.g. by splines), there are methods to enforce f''>=0. But for function interpolation, it does...

plus de 2 ans il y a | 1

Charger plus