Answered
RK4 method for system of ODEs
https://www.google.de/search?source=hp&ei=E994XNKfMYPKwALsyYLwAw&q=matlab+%26+rk4+code&btnK=Google-Suche&oq=matlab+%26+rk4+code&...

7 years ago | 0

Answered
Solve a system of equations
function main x0=zeros(8,1); sol=fminsearch(@(x)fun(x(1),x(2),x(3),x(4),x(5),x(6),x(7),x(8)),x0) sol=fminsearch(@(x)fun(x(1),...

7 years ago | 0

| accepted

Answered
In Ode15s, how do I break the time span into smaller intervals and call the solver twice, so that the integration proceeds faster?
tspan1=[t0 t1]; [ta,y1]=ode15s(@odefun,tspan1,initialCond,solverOptions,additionalParams); initialCond=y1(end,:); tspan2=[t1 ...

7 years ago | 1

Answered
Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on error is 2.4e+02. The integral may not exist, or it may be difficult to approximate numerically to the requested accuracy.
E1=@(x)besselj(0,r/d.*x).*sqrt(x.*tanh(x)).*x.*sin(sqrt(9.81*t(i)^2/d.*x.*tanh(x))).*(sin(a/d.*x)-a./d.*x.*cos(a/d.*x))./(a/d.*x...

7 years ago | 1

Answered
less time to run how
Usually, fun is called for a vector of x-values and must return an array of the same size. ArrayValued = true forces "integral" ...

7 years ago | 0

Answered
The collocation scheme used by bvp4c is the fourth order Lobatto IIIa Runge-Kutta formula or Simpson????
From the documentation: bvp4c is a finite difference code that implements the three-stage Lobatto IIIa formula. This is a collo...

7 years ago | 0

Answered
How to get only one or two output times from ODE solver?
If you use two elements in tspan, ode15s returns the solution at intermediate output times chosen from its internal stepsize con...

7 years ago | 0

| accepted

Answered
Shooting Method On Harmonic Equation
function main ydot0_start = 1.0; a = 2.4; iflag = 0; sol = fzero(@(x)fun_shooting(x,a,iflag),ydot0_start); iflag ...

7 years ago | 1

| accepted

Answered
Parameter estimation in ODE45.
Why do you think the number of unknowns and the number of equations do not match ? You have 4 equations in 4 unknowns. (Of cours...

7 years ago | 0

| accepted

Answered
Could anyone help to combine three matrix into single matrix.
A_combined = [A1(:,1),A2(:,1),A3(:,1)];

7 years ago | 0

Answered
Solving Multiple First Order Differential Equations for Constants
Replace the time derivatives by difference quotients. Then you get a linear system of equations A*[k1;k2;k3;k4;k5;k6] = b wh...

8 years ago | 1

| accepted

Answered
Evaluating a complex integral
format long fun = @(t,x,y) exp(-t.^4 + 1i.*y.*t - x.*t.^2 + 1i*pi*0.125); P = @(x,y) integral(@(t)fun(t,x*exp(-1i*pi*0.25)...

8 years ago | 0

| accepted

Answered
Is it possibile to use fsolve(fun,x0) giving input to fun?
fun = @(x)root2d(x,a,b,c,d,e,f)

8 years ago | 1

| accepted

Answered
Summation with FOR loop question
format long fak = 1.0; s = fak; for i = 1:1600 fak = fak/i; s = s + fak; end s exp(1)

8 years ago | 1

Answered
How to make polynom with unknown coefficients?
n = 10; c = sym('c', [1 n]); p = poly2sym(c)

8 years ago | 0

| accepted

Answered
How to solve a complex equation which has one equation but two real variables?
Does that help ? >> syms z k >> z0 = 1+3*1I; >> a = solve(z==k*z0,z) a = (sym) k*(1 + 3*I) >> real(a) ans = (sym) re(k) - ...

8 years ago | 0

Answered
Double or higher order integration by numerical method
Divide the y-interval of integration into subintervals ystart = y1 < y2 < y3 < ... < yn = yend and call your function "traorl"...

8 years ago | 1

Answered
Symsum and sum output different result
Try n = 1:10000; lamda = n*pi/a; pih = ((lamda+h/k1)-(lamda-h/k1).*exp(-2*lamda*t1))./((lamda+h/k1)+(lamda-h/k1).*exp(-2*lamd...

8 years ago | 0

Answered
How to iterate until convergence?
The structure of your code should look like: function main V = linspace(0.01,0.25,1000); R = zeros(numel(V),1); R0 =...

8 years ago | 0

| accepted

Answered
How to add limit condition to existing code
If you are not satisfied with the approximation for h=0.01 in the code, you could evaluate the function fgl_deriv for two or thr...

8 years ago | 0

| accepted

Answered
How to solve a Partial Differential Ecuation?
The code at the end of the link solves a single equation. MATLAB does not have the ability to symbolically solve PDEs. If you w...

8 years ago | 0

| accepted

Answered
Plotting implicit equation with fimplicit
function main fimplicit (@(x,y)f(x,y)) end function fun = f(x,y) n = 8; a1 = 1.0086*y - 0.9216*(x - y); b1 = 1.0107*(...

8 years ago | 0

| accepted

Answered
What are the boundary conditions of interp1 function?
MATLAB uses a "not-a-knot" end condition for splines.

8 years ago | 1

Answered
How can numerically compute eigenvalues of an ordinary differential equation in MATLAB?
https://www.wolframalpha.com/input/?i=y''(x)%2B1%2Fx*y'(x)%2Ba*(1-x%5E2)*y(x)%3D0,+y'(0)%3D0 So you are left with the problem t...

8 years ago | 0

Answered
How to solve a Partial Differential Ecuation?
Here is code to start from: https://de.mathworks.com/matlabcentral/answers/440015-first-order-partial-differential-equations-sy...

8 years ago | 0

Answered
Calculate derivative of erfcx(x) function
Try x = 0:0.1:5; analytical_derivative = -2/sqrt(pi) + 2.*x.*erfcx(x); numerical_derivative = (erfcx(x+1.0e-6)-erfcx(x))*1e6;...

8 years ago | 0

| accepted

Answered
Taking the second derivative
second_der = zeros(size(V_preamp)); second_der(2:end-1) = ((V_preamp(3:end)-V_preamp(2:end-1))./... (M(...

8 years ago | 2

| accepted

Answered
Beam Equation - problem with boundary condition
v = vx = 0 at x=L w = wx = 0 at x=0 ?

8 years ago | 0

Answered
Extrapolate best-fit line
If you have the coefficients c(1) and c(2) of the fit line l(x)=c(1)+c(2)*x, just evaluate the equation at the x-coordinate of t...

8 years ago | 0

| accepted

Answered
How to plot a function of two variable
https://de.mathworks.com/help/matlab/ref/surf.html

8 years ago | 0

Load more