Answered
Troubles with ode45 solving two ODEs?
1. Solve both equations together: a) Use f=[dp0dz; dp1dz]; instead of f=[dpodz; dp1dz]; b) Use y0=[1 0]...

8 years ago | 1

| accepted

Answered
maximin optimization in matlab
https://de.mathworks.com/matlabcentral/answers/91597-is-it-possible-for-fminimax-to-be-used-to-do-maximin-problems-in-matlab-7-8...

8 years ago | 0

Answered
I got such an error while running this code.
dx(2)=-x(1)+(1-0.2*x(2)^2)*(x(1)+x(2)*cotd(x(3)))/(x(2)^2-1); instead of dx(2)=-x(1)+(1-0.2*x(2))*(x(1)+x(2)*cotd(x(3)...

8 years ago | 1

Answered
Output a variable each time step using ODE45
Use the "event" facility of ODE45. It will help you to exactly locate the time when the valve is open. Take a look at the "ba...

8 years ago | 1

Answered
i want to solve the ivp y'=(2+x)*y^2 , y(0)=1 with matlab using the fourth order R-K method, but my m-file is not working. Please help me.
y(1)=1; % for i=1:nn t=(i-1)*h; t2=(i-0.5)*h; t1=i*h; ex=-2/(t^2+4*t-2); er(i)=abs(ex-y(i)); k1=h*f1(t...

8 years ago | 0

Answered
Why does my code for shooting method using 'ODE45' or 'ODE23s' does not converge to the boundary value.?
Try to start with the solution you get from "bvp4c" for the vector x. Best wishes Torsten.

8 years ago | 1

| accepted

Answered
Why is this singular?
You return NaN values to ode15i within your vector "res". So you should check your inputs. Best wishes Torsten.

8 years ago | 0

Answered
Evaluating an ODE until you reached a certain distance using a while loop: Train/distance problem
Use the "Event" option of ode45 to locate the t-value at which R=3. Best wishes Torsten.

8 years ago | 0

Answered
Error in Finite Difference Method for ODE Code
Maybe you mean p(X) = @(X)(1 + 0*X); q(X) = @(X)(2 + 0*X); r(X) = @(X)cos(X); ? Best wishes Torsten.

8 years ago | 0

| accepted

Answered
Nonlinear equations & fsolve. Error "Failure in initial objective function evaluation. FSOLVE cannot continue."
x0 must have 8 elements, not 2. Best wishes Torsten.

8 years ago | 1

| accepted

Answered
Inner matrix dimensions must agree.
func = @(t) sin(t).*cos(t).^2; x = 0:10:90; theta = deg2rad(x); for i=1:numel(theta) q(i) = integral(func,0,th...

8 years ago | 0

| accepted

Answered
How to evaluate this triple Integral?
g = @(x,y,z)x-x+1; u = integral3(g,1,2,1,3,1,4)

8 years ago | 2

| accepted

Answered
How to generate all the 3 by 3 matrices ?
1. Generate all possible arrangements of length 8 of the numbers 1,...,20 with repetition (e.g.using https://de.mathworks.com/ma...

8 years ago | 0

Answered
why can't I get a simpel solve function to work
syms t z p = 0.6827; o = exp(-z^2/2); h = 1/sqrt(2*pi)*int(o,z,[-t t]); sol = solve(h == p,t)

8 years ago | 0

Answered
Matrix dimensions must agree. Error in electromagnet (line 10) Fe = nu_0.* N1.* N2.* s.*(i0./x).^2 ;
i0 and x must have the same number of elements for the expression i0./x to make sense. Best wishes Torsten.

8 years ago | 0

Answered
How to solve polyfit(x,y,1) by hand?
If you only have two points for a polynomial of degree 1, you have to solve a linear system of two equations: 3 = a*1 + b ...

8 years ago | 0

Answered
ODE45 Event option question
My guess is that your r must be r = Y2(2)-1.2*Vstall Best wishes Torsten.

8 years ago | 0

Answered
How to solve non linear equation for one variable?
The left-hand side of your equation (6.046.*sqrt(...)...) is a scalar, the right-hand side (yieldstress) is a vector. This is no...

8 years ago | 0

Answered
error using fminbnd: Error in fminbnd (line 228) x= xf; fx = funfcn(x,varargin{:});
Replace 1,679 by 1.679. Best wishes Torsten.

8 years ago | 2

Answered
How to write a Bessel function but with my own set values?
"ka" is 1x6, "theta" is 1x4. What do you expect "nu" to be ? At least you will have to set H = abs(2*besselj(0,nu)./nu);...

8 years ago | 0

| accepted

Answered
solving a function with indecis
All variables must be defined *before* you use them. Look at the first line of your loop: here, yi, c1 and c2 are not yet def...

8 years ago | 0

| accepted

Answered
Warning with fsolve
fun=@(x)[(4e4 - 1.1*x(1)^0.91*4e4^0.091)/200 - x(2); 640*pi*quad(@(t)t.*((4e4-200*t)/(x(1)*1.1))^10, 0, x(2)) - 4e6]; initi...

8 years ago | 0

Answered
ODE45 for a second order differential equation
[x,y] = ode45(@fun,[0 9],[0 -28]); function dy = fun(x,y) dy = zeros(2,1); dy(1) = y(2); dy(2) = 2*y(1)+8*x*(9...

8 years ago | 3

| accepted

Answered
How to solve the coupled second order differential equations by using "ODE45"?
You already included the correct signs of the coefficients in the definition of Kmat and Cmat. Thus all terms in dxdt(2) and dxd...

8 years ago | 0

| accepted

Answered
Solving a system of equations - 2 differential and 1 not.
I doubt that dsolve can find an analytical expression for the solution of your ODEs. Use a numerical solver instead (e.g. OD...

8 years ago | 0

Answered
NONLINEAR EQUATIONS WITH FSOLVE
Call fsolve in a loop for the different termperatures. Save the solutions of each run in a (2xn) matrix (n = number of temperatu...

8 years ago | 1

Answered
solve an equation by functions and plot it
tspan=0:0.1:10; zt0=[0 0]; w = [2 6]; for i=1:numel(w) [T,Z_actual] = ode45(@(t,z)func2q2(t,z,w(i)),tspan,zt0); ...

8 years ago | 0

| accepted

Answered
How can i solve a pde by runge- kutta function?
Don't make things more complicated than they are - use ODE15S to solve the system of ODEs. Best wishes Torsten.

8 years ago | 0

Answered
Why no output is obtained when I run a code to solve an ODE by Runge-Kutta 4th order method
Compare with the analytical solution of your equation: https://www.wolframalpha.com/input/?i=h'(t)%3Da*(h(t))%5E2%2Bb*h(t),h(...

8 years ago | 0

Answered
Inequality Constraints on Parameter Estimates using lsqnonlin
Instead of b, use c+b'^2 and instead of a, use c+b'^2+a'^2 in your equations and solve for c, b' and a'. Then c=c, b=c+b'^2 ...

8 years ago | 0

| accepted

Load more