Answered
solving non linear differential equations
a = -0.2; b = 0.1; c = 0.1; epsilon = 1.0; fun = @(t,y)(t*y*(y-a)*(y-b)+c)/epsilon; tspan = [0 3.5]; y0 = 0; [T,Y] = ode4...

8 years ago | 0

| accepted

Answered
How to find the differential equation ? ode solver
If the output plot function is f(t) and f(t0)=f0, then the corresponding ODE reads dy/dt = f'(t) with y(t0) = f0. This ODE sh...

8 years ago | 1

| accepted

Answered
ODE45 error message "Error using exist The first input to exist must be a string scalar or character vector"
param = fminsearch(@lau,param0) [t,w] = ode45(@grinding,[t0 tp],w0)

8 years ago | 1

| accepted

Answered
Fsolve for a generalizable number of equations.
A = [1, 0, 0, 0, 1/sub(1,1), 1/sub(2,1), 0, 0;... 0, 1, 0, 0, 1/sub(1,2), 1/sub(2,2), 1/sub(3,2), 0;... 0, 0, 1, 0, ...

8 years ago | 0

| accepted

Answered
two-step Adams Moulton method
In the Adams-Moulton formula, y(i) appears on both sides of the equation. This means that the Adams-Moulton method is implicit. ...

8 years ago | 0

Answered
Numerical integration twice wrt same variable
fun1 = @(x)integral(@(r)((r+1).^2+1)./r,1,x); fun2 = integral(@(x)(1+fun1(x)),0,1,'ArrayValued',true)

8 years ago | 1

| accepted

Answered
Uniform distribution command for specific mean and standard deviation
(mean-sqrt(12)/2*s.d.) + sqrt(12)*s.d.*rand(N,1) is uniformly distributed on [a:b] = [m-sqrt(12)/2*s.d.:m+sqrt(12)/2*s.d.] ...

8 years ago | 1

| accepted

Answered
Error calculating matrix operations
for i=1:14 ACCANG(:,i) = (-(Jinv))*([AB*(w2(i))*cosd(beta(i)), BO*(w3(i))*cosd(gamma(i)); -AB*(w2(i))*sind(beta(i)), -BO*(w3(i)...

8 years ago | 1

| accepted

Answered
How can I plot ode 45 for different values of a constant after specific time?
function main T = 1:1:3100; del = 0.0; [t1,y1] = ode45(@(t,y)f_1(t,y,del),T,C); T = 3100:1:3500; del = 1.0; C ...

8 years ago | 1

| accepted

Answered
Absolute Value in optimization expression
min: eps + (a*x + b*y + c*z - d) - eps <= 0 - (a*x + b*y + c*z - d) - eps <= 0 subject to x,y,z are integers in some range wi...

8 years ago | 1

Answered
How to find parameters of differential equation which fit data using gradient descent?
This is the standard example on how to proceed in your case: https://de.mathworks.com/matlabcentral/answers/43439-monod-kinetic...

8 years ago | 0

Answered
Solving System of Marices
N = 100; fun = @(x) x.^2 - Dg*x - Di; x0 = zeros(N,1); sol = fsolve(fun,x0)

8 years ago | 0

| accepted

Answered
how to creat this vector?
X=[1 0 0 1 1 0 1 1 1 1 0 0 0 1 1 0 1 1 1 1 1 0]; if sum(X)>3 X=[0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 0]; end

8 years ago | 0

Answered
system of non linear equations of the same form
x = fsolve(@(x)myfun(x(1),x(2:n),x0)

8 years ago | 0

| accepted

Answered
traveling salesman problem code
https://de.mathworks.com/matlabcentral/answers/441041-how-to-compute-possible-route-for-travelling-salesman-problem

8 years ago | 0

| accepted

Answered
The inverse of a function numerically with N-terms
p = [b*fliplr(m((N+2)-N:(2*N)-N)),b+a*m(1),-z,a+b*m(1),b*m(N-(N-2):N-0)]; roots(p)

8 years ago | 0

| accepted

Answered
Solve a numerical equation
x0 = 0 leads to a divison by zero since sin(x0/2) = sin(0) = 0

8 years ago | 0

Answered
How to divide unequally between two points such that nearby one point the discretization points will be crowded and on the other end it will be uniform
theta(1)=0.05; for n=2:40 theta(n)=theta(n-1)+1e-12*2.016233701097243^(n-1) end

8 years ago | 0

| accepted

Answered
solving linear systems of equations
The matrix C is singular. Check whether the linear system C*x=D is solvable at all (Remember the rank condition rank (C ) = ran...

8 years ago | 0

Answered
non-linear fit to find constants in the equation
E =...; % column vector U =...; % column vector A = [ones(numel(E),1), E, E.^2, E.^3, E.^4]; b = U; sol = A\b; C1 = sol(1...

8 years ago | 1

| accepted

Answered
BVP4c Solving two equations simultaneously
init = bvpinit(linspace(0,1,10),[0,0,0,0,0]); sol = bvp4c(@rhs_bvp, @bc_bvp, init); x1 = linspace(0,1,100); BS = deval(sol, x...

8 years ago | 0

Answered
How to calculate the derivative of function that is referred to in another function?
syms x func =-2.18 +5.0768*x-2.6870*(x^2)+0.5129*(x^3)-0.0318*(x^4); dfunc = diff(func,x);

8 years ago | 0

| accepted

Answered
Numerical calculation of line integral over a vector field
The usual way is to approximate the integral as sum_{i=1}^{n-1} [ (rx(t(i+1))-rx(t(i))/(t(i+1)-t(i)) * Fx(gamma((t(i+1)+t(i))/2...

8 years ago | 0

Answered
Solving system of equations with constraints
Linear optimization codes that use the simplex method always return corner points of the LP problem as solution. Maybe options...

8 years ago | 0

Answered
norminv to solve for sigma
x = ...; mu = ...; p = ...; sigma0 = 1.0; sigma = fzero(@(y)normcdf(x,mu,y)-p,sigma0)

8 years ago | 1

Answered
I am getting error in integrating a function from 0 to infinity wrt x. Kindly help.
q=integral(fun,0,Inf,'ArrayValued',true)

8 years ago | 0

Answered
I am trying to solve 3 simultaneous nonlinear system of equations by newton's method.
Don't use symbolic variables together with Newton-Raphson. Instead of using "jacobian" , look at the solution suggested by John...

8 years ago | 0

| accepted

Answered
Solving 2 second order differential equations
Take a look here https://de.mathworks.com/help/symbolic/solve-differential-algebraic-equations.html to see how to setup your ...

8 years ago | 0

Answered
Using ode45 to model equations of motion for a coupled nonlinear system of ordinary differential equations
subplot(212) R = 5.938; plot(t,z(:,3)*R); grid on xlabel('Time (sec)'); ylabel('\zeta_s');

8 years ago | 0

| accepted

Answered
Best Cubic Polynomial fitting
mat = [a a.^3]; rhs = b; sol = mat\rhs; p = sol(1) q = sol(2) fun=@(x) p*x + q*x.^3; bb = fun(a); plot(a,b,a,bb)

8 years ago | 0

Load more