Community Profile

# Torsten

2,471 total contributions since 2013

View details...

Contributions in
View by

Having Trouble Using For-Loop Over Distributed Range with ODE45
delta1 = @(t) (t<=1200) delta0 = @(t) (t>1200) ODE = @(t,x,gamma,psi,beta) [delta1(t)*(-gamma)*x(1) + delta0(t)*psi*x(1); beta...

약 17시간 ago | 3

| accepted

Substitution of initial numerical values before odefunction
Use "matlabFunction" to convert every symbolic input to ODE45 into numerical function handles before calling ODE45.

약 18시간 ago | 0

How do I maximise Volume of a cylinder such that its Surface Area is less than 10 using fmincon by predicting only either radius or height but not both?
Not possible. Since r and h are interdependent, "fmincon" must be able to vary both and thus predict them simultaneously. Of co...

1일 ago | 0

| accepted

How to fix "Index exceeds the number of array elements (1)"?
for i=1:length(L) psi0= psi(i); L0 = L(i); To=[cosd(psi0) sind(psi0) 0; -sind(psi0) cosd(psi0) 0; 0 0 1]; Tg=[To ze...

2일 ago | 1

How to fit multivariable equation?
coeffs = [inputs, ones(size(inputs,1),1)] \ outputs

3일 ago | 0

I need help in this question please?
y(t) = sum_{i=0}^{Inf} a_i*t^i y'(t) = sum_{i=1}^{Inf} i*a_i*t^(i-1) y''(t) = sum_{i=2}^(Inf} i*(i-1)*a_i*t^(i-2) Set y''(t)+...

3일 ago | 0

How to calculate the (odd ,even) condition in the following Poisson distribution for p_z parameter? i need some help in the code bellow
function main p1 = 0.9; p2 = 0.8; q1 = 1-p1; q2 = 1-p2; z = 6; vec = zeros(1,z); vec(1:2:end) = q1/p1; v...

6일 ago | 1

Lagrange Interpolating Polynomials using Matlab
You must use a fitting tool, not an interpolation tool to solve your problem. Apply "polyfit" with x-values = Generation Output...

6일 ago | 0

| accepted

CDF of rain rate
https://stackoverflow.com/questions/36385036/how-to-make-a-cdf-from-a-histogram-in-matlab

6일 ago | 0

How to define a variable as an integer that's equal to or greater than zero?
rest = mod(struct_idx,4); if rest == 1 ... elseif rest == 2 ... elseif rest == 3 ... elseif rest == 0 ... end

6일 ago | 0

| accepted

Matlab code for delay differential equations
https://de.mathworks.com/help/matlab/delay-differential-equations.html

6일 ago | 1

| accepted

How to solve this equation which contains complex number, bessel equation and its derivative?
x0 = [2; 1]; fun = @(x)[real(1i*besselj(1,complex(x(1),x(2)))-complex(x(1),x(2)).*(besselj(0,complex(x(1),x(2)))-besselj(2,...

7일 ago | 1

Finite difference method - solving boundary conditions
y1(1) - 1.0 = 0 (y1(i+1)-2*y1(i)+y1(i-1))/dx^2 - (2*(y1(i+1)-y1(i-1))/(2*dx)/(1-x(i)) + y1(i)/(x(i)^2*(1-x(i))^2)*(y1(i)^2-1+(y...

9일 ago | 0

| accepted

How to enforce ode15s to solve a DAEs system with some state variables limited by a range?
The solution of your problem is uniquely determined by the equations you impose - you can't impose any further conditions on the...

10일 ago | 0

| accepted

Solving boundary value problem for nonlinear differential equation using method of collocation - Gauss sites
Up to my experience, the FORTRAN code "colnew" and "colsys" developed by Ascher are still the best bvp solvers available. Searc...

13일 ago | 0

| accepted

How to solve a set of DAEs with multiple dependent differential variables
The Euler equations are not thus easy to solve. You should consult a book on numerical methods for the equations of gas dynamic...

13일 ago | 0

Boundary condition in non-linear ODE
function du = ode4(eta,u) theta = u(1); Sr = u(2); % beta dtheta = u(3); % d(theta)/dr ...

13일 ago | 1

| accepted

How can I create a loop for this equation?
L = cumsum(demand); L = L./(1:numel(L)); L = L(4:12)

14일 ago | 1

How to solve a non-linear system of difference equations ?
Call "fsolve" repeatedly to get (S3,K2,E2), (S4,K3,E3), ... (S(t+2),K(t+1),E(t+1)) A(t) = A(1)*(1+a)^(t-1) is obvious.

15일 ago | 0

Nested loop problem with the second index
cp = zeros(length(cpx)*length(cpy),2); row = 0; for i = 1:length(cpx) for j = 1:length(cpy) row = row + 1; ...

16일 ago | 0

how to solve differential equation when the derivative is in right and left side of the equation.
MATLAB solves ODE systems of the form A(t,x)*dx = f(t,x) So put all dx terms on the left-hand side, determine the matrix A and...

16일 ago | 0

| accepted

How to plot a continuous graph from distinct points.
x=[1 3 5 6]; y=10*ones(size(x)); plot(x,y,'o')

21일 ago | 0

Matlab code for boundary condition
So you mean at x=0, you have y = 0 and dy/dx + dz/dx at x=infinity, you have y=1 and z = b and at t = 0, you have y = 1, z...

21일 ago | 0

How to find the X-coordinate of the plot knowing the Y-value?
[~,index] = max(max0); frequency_value = f(index)

21일 ago | 0

| accepted

pdepe solver boundary condition setup for discrete measured heat flux data
By setting pl = 0.0; ql = 1.0; qr = Area of the side face of the slab; pr = q(t); in the function where you define the boun...

21일 ago | 0

How to determine whether point lies within pyramid volume
Another program for your issue: https://de.mathworks.com/matlabcentral/fileexchange/10226-inhull

21일 ago | 0

Complex values computed by fit.m function (Curve fitting Tool)
Since your fitting problem is linear in the coefficients a1,a2,a3,..., this is all you need to get the best fit parameters: A =...

21일 ago | 0