Answered
Is there an easy way to make numerical simulations of the ODE of the form dx1/dt=x1(2-x1-x2), dx2/dt=x2(3-x1-x2-x3) for any xn?
n = 5; tspan=[0 15]; x0 = [2 3 4 6 8]; [t,x] = ode45(@(t,x) derivatives(t,x,n), tspan, x0); function dx = deri...

8 years ago | 1

| accepted

Answered
Read time variable parameter values in an ode-solver loop
You shouldn't use this approach. Better do this: parameters = xlsread('feed.xlsx'); [cumgas comp frac] = solver(param...

8 years ago | 1

| accepted

Answered
Definit integral within a larger equation for a root mean square calculation
t0 = 0; t1 = 0.01; f = 1.0/0.02; Vrms = sqrt(1/(t1-t0)*integral(@(t)sin(2*pi*t*f).^2,t0,t1)) Best wishes Torste...

8 years ago | 0

| accepted

Answered
Ode45 returns NaN, Why?
rho = 1.226*exp(-1.387e-4*(0.3256-6378000)) ~ 1.226*exp(885) !!! Best wishes Torsten.

8 years ago | 0

| accepted

Answered
Solving two equations with ODE45
fun=@(x,y)[y(2);y(3);-(1+x^2)*y(4);y(5);y(6);(1+x^2)*y(1)]; %psi2,psi2',psi2'',psi1,psi1',psi1'' Best wishes Torsten.

8 years ago | 0

| accepted

Answered
Testing the mean of multiple rand(N) variables
You implicitly assume that (mean(X))^4 = mean(X^4). This is not true. (mean(X))^4 = 1/2^4 = 1/16, but mean(X^4) = ...

8 years ago | 0

Answered
Calculate summation with loop or sum
for i=1:numel(f) f_actual = f(i); S(i) = a*f_actual^b+c+sum(Amp.*exp(-(f_actual-Freq).^2./(2*Eca.^2))); end pl...

8 years ago | 0

| accepted

Answered
normcdf and norminv for symbolic function
fun = -(k-sqrt(1-rho)*norminv(x))/sqrt(rho); density = 1/sqrt(2*pi)*exp(-fun^2/2)*diff(fun,x) Best wishes Torsten.

8 years ago | 0

| accepted

Answered
Calculating the angle in a triangle over time when the length of all three edges is known and when one of the angles is 90 degrees.
if x_coordinate of p1 > x_coordinate of p3 angle = 180/pi*acos(...); else angle = -180/pi*acos(...); end

8 years ago | 0

Answered
How do you add white noise to a nonlinear ODE?
x must be a scalar in your ODE function - I doubt that this is the case. Best wishes Torsten.

8 years ago | 0

| accepted

Answered
Interpolate y-values from x-values, outside the limit of the x-values
https://de.mathworks.com/help/matlab/ref/interp1.html#btw2a2x Best wishes Torsten.

8 years ago | 0

Answered
why i get this error when using integral?
The solution is given in the error message: an = (2/T) * integral(@(t) exp((10 - t) / 2).*cos(2*pi*f0*n*t), 0, T, 'ArrayVal...

8 years ago | 4

| accepted

Answered
Finding a particular solution to second order differential equation
Doesn't look as if you could get an analytical solution for this equation. Give values to the parameters involved and try a ...

8 years ago | 0

Answered
solve 12 equations with 12 unknown ERROR: FSOLVE requires all values returned by functions to be of data type double.
Remove all the "== 0" strings. Best wishes Torsten.

8 years ago | 0

| accepted

Answered
Equivalent of Excel Solver, fminunc?
function res=f_Makeham(param,y_given) a0=param(1); b0=param(2); c0=param(3); x=(77.5:1:100.5)'; res=sum((a0+b0*...

8 years ago | 0

Answered
Is there a code to find the Jacobian matrix of a system of nonlinear equations?
https://de.mathworks.com/matlabcentral/fileexchange/13490-adaptive-robust-numerical-differentiation Best wishes Torsten.

8 years ago | 0

Answered
How do I use fsolve to solve a system of non linear equations where there are function of functions ?
sol = fsolve(@rootnle,x0) Best wishes Torsten.

8 years ago | 1

Answered
integration question related with exponential and algebraic.
After assigning specific values to K1, K2 and K3, you can use MATLAB's "integral". A symbolic formula ínvolving K1, K2 and K3...

8 years ago | 0

Answered
Constrained Optimization of Implicitly Defined Function
Sure. Use "fmincon" to solve max y s.t. p(1)*exp(r(1)/y) + ... + p(n)*exp(r(n)/y) - 1 = 0 x'*ones(n,1) = 1...

8 years ago | 0

Answered
I am unable to obtain multiple graphs by varying a parameter in a for loop while solving a Runge-Kutta based problem
clear;clf;clc; %parameters s=0.01; t_final=10; global Re Pr R phi b eps Mn Bi alp rhof cpf kf rhos cps ks h_t ...

8 years ago | 1

| accepted

Answered
multidimensional numerical integration without large matrices
x2min = ...; x2max = ...; x3min = ...; x3max = ...; x4min = ...; x4max = ...; a = ...; b = ...; c = .....

8 years ago | 0

Answered
how i get the x and y value with two given eqation
I don't know the syntax for MATLAB version 2014, but in the present version, it should look like Xc(4) = 0.9304; Yc(4) =...

8 years ago | 0

Answered
System of equations coding problems
n = 10; A = full(gallery('tridiag',n,1,2,3));

8 years ago | 0

Answered
Is it possible to specify length of an array that is a result from ode15s
https://de.mathworks.com/matlabcentral/answers/388499-ode15s-time-vector-size Best wishes Torsten.

8 years ago | 0

| accepted

Answered
Subscripted assignment dimension mismatch : When using ode45
function dydt = EuRodFunc(t,y,a,d) dydt = zeros(4,1); dydt = a.*d;

8 years ago | 0

| accepted

Answered
Integrating Data points in matlab
plot(-4*cos(t/2)+4*cos(0/2));

8 years ago | 0

Answered
How to simplify exponential symbolic equation?
theta1_temp(t)=-log(x1_temp(t)/u1(t))/t theta2_temp(t)=-log(x2_temp(t)/(-log(x1_temp(t)/u1(t))/t*x1_temp(t)+19))/t Best ...

8 years ago | 1

Answered
lsqnonlin - how to return the best fit
Just call the objective function with the x-vector of optimal paramters. It will return the best fit. Best wishes Torsten....

8 years ago | 0

Load more