Beantwortet
How to solve such integrations on MATLAB?
Invest a little time and deduce z^(3*n-1)/(1-z^(2*n)) = -z^(n-1) + 0.5*z^(n-1)/(1-z^n) + 0.5*z^(n-1)/(1+z^n) This function can...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
the fitted data is far from the origin data in power function by lsqcurvefit
The initial guesses for the parameters are very important for convergence. I deduced them from the linearized model log(Y0) = l...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Global variables to plot variables from ODE45 function
t < pi/2 is necessary: syms t x(t) eqn = diff(x,t) == x^2*cos(t); conds = x(0)==1; dsolve(eqn,conds) tspan= 0:.01:10; x=1;...

fast 3 Jahre vor | 0

Beantwortet
Does MATLAB considers poles while COMPLEX integrating a function?
How should it consider it if you ask MATLAB for an antiderivative to a function ? Should it additionally list the poles ? An an...

fast 3 Jahre vor | 0

Beantwortet
为什么显示要串联的数组的维度不一致?
As you can see in your code above, f1f+g1*(unew1-u1f)+L1*(x1-x1f) f2f+g1*(unew2-u2f)+L1*(x2-x2f) f3f+g1*(unew3-u3f)+L1*(x3-x3...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to find two unknown variables in explicit function?
You overwrite z - the 2-element input vector to your function eqns - by setting z=4;

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
Solve the Pendulum problem 2θ¨=-2sinθ-3θ˙
Write your equation as a system of two first-order equations and use ode45 to solve.

fast 3 Jahre vor | 1

Beantwortet
Matrix to Scalar Problem
x=C*exp(-Damp_Coef*W*t).*cos(Wd*t-alfa);

fast 3 Jahre vor | 0

Beantwortet
I have a MATLab invalid expression when calling variables.
@(x) constraints(x;Y_bus; num_gen_buses; num_oltc_buses; svc_bus; V_max;V_min; S_max)... Function inputs are separated by ",", ...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Solving an equation consisting of a PDE and ODE
The discretization can be taken from the attached document (formulae 3.1 (c) and 3.2 (c)). %Given parameters espo=0.269; gamma...

fast 3 Jahre vor | 2

| akzeptiert

Beantwortet
When does an anonymous function reach a specified value?
threshold = 100; a = 0.5; fun = @(x) exp(a*x) - threshold; solx = fsolve(fun,1) exp(a*solx)

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Index exceeds the number of array elements. Index must not exceed 100
You initialize eta1 and eta2 as arrays of zeros with 100 elements. When your loop reaches n = 100, you try to access eta1(101) ...

fast 3 Jahre vor | 0

Beantwortet
Writing functions f(x,y)
f = @(x,y)4*(x-1)^2+3*(y-2)^2+2*(x-2)^2*(y-3)^2; z0 = [1 1] sol = fminsearch(@(z)f(z(1),z(2)),z0) f(sol(1),sol(2))

fast 3 Jahre vor | 3

Beantwortet
How can I update my symbolic expression?
c2_sol = solve(subs(def1,x,0)==0,c2) And for every expression where you want to substitute c2 by c2_sol: subs(expression,c2,c2...

fast 3 Jahre vor | 0

Beantwortet
Complex solutions in ODE solver
x^12.94 can give complex values for the derivatives if x < 0.

fast 3 Jahre vor | 1

Beantwortet
Determination of distribution parameters from quantile values
fit1_Werte = 0.713666092353130; fit2_Werte = 0.535608240510766; fun = @(x,y)[gaminv(0.01,x,y) - fit2_Werte;gaminv(0.5,x,y) - f...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Implementing Finite Difference Scheme
Approximate the derivatives in r, not in rc. Use formula (3.2 c) from the attached document (with c = 1 in your case) for r = ...

fast 3 Jahre vor | 0

Beantwortet
How best and most efficient way to build this matrix
Experiment with "spdiags": https://uk.mathworks.com/help/matlab/ref/spdiags.html If first and last row appear different from y...

fast 3 Jahre vor | 0

Beantwortet
Electroadsorption PDE with langmuir Isoterm
Try pde1dm https://uk.mathworks.com/matlabcentral/fileexchange/97437-pde1dm?tab=reviews or else use the method-of-lines approa...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
Error in Variables Regression
Linear Total Least Squares Regression means minimizing the sum of distances of projections of your data on a linear subspace. Th...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Find a variable from an integration equation
ct=@(speed,motor_power)base_speed1./(motor_power-(a+b.*speed.^2).*base_speed); %Function 1% cp=@(speed,motor_power)speed./(moto...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
Error on Symbolic calculation : "Empty sym : 0-by-1"
Try this code. By the way: numel(v1(i,j)), numel(v2(i,j)) and numel(v3(i,j)) always equals 1 because v1(i,j), v2(i,j) and v3(i,...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
symbolic function give error list of equations must not be empty
syms Shy Por_den = 0.4:0.1:0.8; W= 1.2; rho_ma = 2.75; rho_water = 1.03; rho_hydrate = 0.90; Measure_VEL=1.4:0.1:1.8; vw= 1.49...

fast 3 Jahre vor | 0

Beantwortet
Need help in using trapz to integrate a definite function
Maybe you mean clear all c=3*10^8; % speed of light in vaccum h=6.626*10.^-34; % Planck constant k=1.38*10.^-23; % Boltz...

fast 3 Jahre vor | 0

Beantwortet
Problem in solving equation with Gamma distribution parameters as unknowns
I'd try it numerically. Better initial values for y,z and la might give convergence. fun = @(y,z,la)[gaminv(0.95,y,z)-gaminv(0....

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to fit a histogram plot to a poisson distribution
Simply use lambdahat = poissfit(spacing_ratios) But I'm surprised you want to fit data that take non-integer values with a dis...

fast 3 Jahre vor | 0

Beantwortet
why the plot of C is a constant through the time (differential equation résolution)
You start with an initial value y02 = 0. The rate of change of Y2 is z2 = 4.*(0.1.*exp(-5000./(8.314.*300))).*y, thus 0 since ...

fast 3 Jahre vor | 1

Beantwortet
I want to know which of the two spaces each point belongs to in a 3-dimensional space divided into two parts by a single plane.
The two half-spaces that IR^3 is divided in by the plane are a(x-p)+b(y-q)+c(z-r) < 0 and a(x-p)+b(y-q)+c(z-r) > 0. So for a gi...

fast 3 Jahre vor | 4

| akzeptiert

Beantwortet
Solve closed loop system equation with disturbance input via function handle
By using interp1 to interpolate the column value to the time instant of the ODE integrator. Or use your own integrator with a f...

fast 3 Jahre vor | 1

Beantwortet
How do i store the output from my for loop for each iteration
You must return "store", not "sol" to the program calling the function "tosolve".

fast 3 Jahre vor | 0

Mehr laden