Respondida
How do i find the global minimum of chi^2 function of two variables?
Turn the function you want to minimize using a numerical solver like "fminunc" or "fmincon" into a function with numerical argum...

más de 3 años hace | 0

| aceptada

Respondida
Solving coupled differential equations
MATLAB is not able to get a solution. Take the one from WolframAlpha: https://www.wolframalpha.com/input?i=y%27%28t%29+%3D+-f%2...

más de 3 años hace | 0

Respondida
When integrating numerically with Integral 2, the integral contains a vector, resulting in an error: Arrays have incompatible sizes for this operation.
R = 5; r = 6:0.1:9; theta = [0,pi/6,pi/4]; %A = @(r,theta,rr,phii) ((r.*sin(theta)-rr.*sin(phii)).^2+r.^2.*cos(theta).^2+rr.^...

más de 3 años hace | 0

| aceptada

Respondida
Issues when stracting from an ODE 45 that depends on a derivative
yc and t are scalars, thus single values. diff(yc)/diff(t) makes no sense in this case. Simply use dyc = -2*sin(t)

más de 3 años hace | 0

| aceptada

Respondida
what's wrong my code about ode model
What is Cprime ? % Define the parameter values k = 1.2; %killing rate of cancer cells by T cells r_C = 1/1.0; % Logistic grow...

más de 3 años hace | 0

| aceptada

Respondida
polyfit vs csapi revolve - can't square the integral on csapi
Take a look here on how to to generate a spline function squared and integrate it: https://de.mathworks.com/matlabcentral/answe...

más de 3 años hace | 0

Respondida
How to pass an array into the initial condition function while using pdepe
However after the solution (1xn array) is achieved, i perform some other calculation and then i want to feed the end result back...

más de 3 años hace | 0

| aceptada

Respondida
Why I got an error in "plot(X1,sqrt(2*g*X1)*tanh(sqrt(2*g*X1)/(2*L)*t),'o')" in the following code??
Seems you got the derivative wrong. % Constants g = 9.81; % m/s^2 v = 4; % m/s t = 3.45; % s L = 5; % m X0 = 3; % m Es = ...

más de 3 años hace | 0

Respondida
Dsolve solves differential equation with a very long output, is something wrong?
syms lambda mu real positive syms t p1(t) p2(t) p3(t) eqn1 = diff(p1,t) == -5*lambda*p1 + mu*p2; eqn2 = diff(p2,t) == 5*lambd...

más de 3 años hace | 1

| aceptada

Respondida
Extracting an intermediate vector from ode45
Use s = zeros(numel(t),1); u = s; z = s; for i = 1:numel(t) [~, s(i),u(i),z(i)] = smc_obsv(t(i), x(i,:)); end instead o...

más de 3 años hace | 0

| aceptada

Respondida
How to numerically solve system of equations and differential equations simultaneously?
MATLAB's ode solvers allow a mixture of differential and algebraic equations as in your case. These systems are called differen...

más de 3 años hace | 2

Respondida
Plot a quadrilateral having 8 points (each side passes through two points)
P1 = [0 0 0]; P2 = [1 0 0]; P3 = [0 1 0]; P4 = [0 0 1]; P5 = [1 1 0]; P6 = [0 1 1]; P7 = [1 0 1]; P8 = [1 1 1]; hold on ...

más de 3 años hace | 0

Respondida
ode45 taking too long to solve set of ODEs.
Try to use ode15s instead of ode45. And prescribe the vector of output times. Otherwise ode45 will save all of its successful i...

más de 3 años hace | 0

Respondida
How to get a better fit with given equations that would approximately match given data output?
Use rng("default") as first line in your code.

más de 3 años hace | 0

Respondida
Finding a nonlinear equation root
fun = @(x)cosh(x).*cos(x)+1; icount = 0; for i = 1:2:21 x0 = i*pi/2; icount = icount + 1; xroot(icount) = fzero(fun,x...

más de 3 años hace | 0

Respondida
Problen with optimization of two parameters, and with differential equations
All curves that stem from your model tend to sqrt(keq/(1+keq)). Since your measurement data tend to 0.5, my guess is that you ha...

más de 3 años hace | 0

Respondida
Problen with optimization of two parameters, and with differential equations
The parameters you want to fit are not independent. Since T remains constant, the complete expression k0*exp(-Ea/(8310*T))*cc*...

más de 3 años hace | 0

Respondida
How to use fmincon's constraintviolation option
Can you tell me what I'm doing wrong? You try to betray yourself that your problem has a solution. But it has none.

más de 3 años hace | 1

| aceptada

Respondida
Solving Integral in matlab
syms s a=sym('1'); b=sym('71/100'); c=sym('53/100'); f = 1/((s+a^2)*(s+a)*(s+b)*(s+c)); F = a*b*c/2*int(f) limit(F-subs(F,...

más de 3 años hace | 0

Respondida
im looking for the error in the following code, please help
DalphaS = CaputoDerivative(S(1:n),alpha,dt); DalphaI = CaputoDerivative(I(1:n),alpha,dt); DalphaR = CaputoDerivative(R(1:n),al...

más de 3 años hace | 0

Respondida
Systems of Trigonometric Equation does not return any value
You get contradicting results for theta10. Thus your system is not consistent. format long AB = 105.58445229; CD = 16.557818...

más de 3 años hace | 0

Respondida
I couldn't match the index no., can anyone please help me to resolve this issue.
yita_mn has size 6x6, but your loop in which you access yita(i,j) runs for i = 1:16 and j = 1:16. And dy should be allocated as...

más de 3 años hace | 0

Respondida
Drawing a heatmap of the max value of a state variable against two parameters in the system
tspan = 0:0.01:100; y0 = [100000;0;0;1;0]; p = 0.001:0.001:0.01; eta = 0.001:0.001:0.02; for i = 1:numel(p) for j = 1:num...

más de 3 años hace | 1

| aceptada

Respondida
volume of a packed bed reactor
One main error in your code is that you use variables that you define later on. Programming works sequentially: If you define a...

más de 3 años hace | 0

| aceptada

Respondida
Finding random normally distributed number above zero
Maybe taking abs(randn()) will give you something useful. It's the folded normal distribution (which in this case equals the tru...

más de 3 años hace | 0

Respondida
Need to remake this optimize function to be efficient takes way to long currently
You can easily solve when det(m) = 0 in advance and insert the formula in your code. This will enhance speed enormously: syms p...

más de 3 años hace | 1

Respondida
numerical integration of array
lam = 0.5; nCk = @(n,kVec,z)arrayfun(@(k)nchoosek(n,k)*exp(-lam*k*z),kVec); integral(@(z) nCk(10,1:5,z),0,1,'ArrayValued',true...

más de 3 años hace | 0

| aceptada

Respondida
ode45 how to write differential equation (within function) that incorporates itself at previous time stamp
This is a delay differential equation. Use dde23 to solve. What are the variables you solve for in the equation dIdt = V*S+ep...

más de 3 años hace | 0

Respondida
calculate integral of this function
F1 = double(int(dM_dH^2/cos(theta),x,0,Pi)) instead of F1= integral(@(x) (dM_dH).^2/cos(theta),0,Pi)

más de 3 años hace | 0

| aceptada

Respondida
Seventh order differential equation
% Set model parameters l = 1; P = 1; Ga = 1; Eatilde = 1; ha = 1; E1tilde = 1; h1 = 1; E2tilde = 1; h2 = 1; xmesh = ...

más de 3 años hace | 1

| aceptada

Cargar más