Beantwortet
HOW CAN I CORRECT THIS ?
It works for me exactly as you have written it, with no error messages!

mehr als 5 Jahre vor | 0

Beantwortet
Family of ODE with summation
Your System_ni function doesn't seem to have acces to your K_Br matrix. You need to pass it into System_ni or specify it within ...

mehr als 5 Jahre vor | 0

Beantwortet
HOW TO SOLVE A SYSTEM OF FIRST ORDER ODE WITH ODE45 SOLVER (knowing that it contains if statment and other parameter depending on the solutions of the system)?
Look at the two asterisked lines in your temperature section below if y(2) < T_b %*********************************************...

mehr als 5 Jahre vor | 0

Beantwortet
MATLAB problem using euler's explict method
If you let dx/dt = vx, say, and dy/dt = vy, then the accelerations can be written as dvx/dt = -gamma/m*vx*sqrt(vx^2+vy^2), and d...

mehr als 5 Jahre vor | 0

Beantwortet
Simulating a free fall-project with ode45
More like this perhaps: hi = 40000; % Initial height start=[hi 0]; % [Initial height, initial velocity] tspan=[0 100]; ...

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
How to find the time and partial derivative?
You don't really need the power of MATLAB here; elementary calculus will do:

mehr als 5 Jahre vor | 1

| akzeptiert

Beantwortet
ı want to calculate the flow variable by the specified input by user. for example when ı take l/d=1 and S=0.20 on the chart and then ı read by hand its almost 4.10. but when ı calculate with my code it gives different result. can you help me?
Use interp1, but get rid of inf (and possibly use more points!) >> S=[0 0.00474 0.0188 0.0446 0.121 0.264 0.631 1.33 6]; >> Q...

mehr als 5 Jahre vor | 1

| akzeptiert

Beantwortet
Newton Jacobi Nonlinear System
Replace e(k+1)= max(xerr,yerr,zerr); with e(k+1)= max(max(xerr,yerr),zerr);

mehr als 5 Jahre vor | 1

| akzeptiert

Beantwortet
how to plot an inverse function?
How about y = -10:10; x = 10-y.^2; plot(x,y),grid xlabel('x'),ylabel('y')

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
Numerically Solving non-linear differential equation
I guess you could treat the equation as a quadratic in (dy/dt)^2, solve for that, then take the square root to get an expression...

mehr als 5 Jahre vor | 0

Beantwortet
How can i write this primitive function ?
You need to make the f's a function of N as well. e.g: F=@(x,N)(x^((N)+1))/((N)+1);% Primitive function then make sure you ca...

mehr als 5 Jahre vor | 0

Beantwortet
periodic boundary conditions for advection for a<0
For left moving instead of ul(J,n)=ul(J-1,n); %peridic BC for left moving shouldn't you have ul(J,n)=ul(J+1,n); %peridic...

mehr als 5 Jahre vor | 0

Beantwortet
Projectile motion with drag and magnus effect. So far im just trying to make it work with air resistance however I get a Index exceeds the number of array elements (1). Error in projectile_golf (line 36) vx(i)=vx(i-1)-FdragX(i-1)*dt;
You don't update FdragX and FdragY. You should add FdragX(i) = v(i)*vx(i)*c; % Drag force in X direction FdragY(i) =...

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
How can i plot it in 3D
Like so x = linspace(-5,5,40); y = linspace(-5,5,40); [x, y] = meshgrid(x,y); z = x.^2+y.^4-2*x*y.^2+1 surf(x,y,z) xlabel ...

mehr als 5 Jahre vor | 0

Beantwortet
Error using odearguments (line 95) SOL returns a vector of length 18, but the length of initial conditions vector is 3. The vector returned by SOL and the initial conditions vector must have the same number of elements.
Your calculations of rad_w and rad_g produce vectors of size 8x1 that lead to tdot being larger than 3x1. Should these two (i.e...

mehr als 5 Jahre vor | 0

Beantwortet
ode45 gave errors
If you want them in different colours on one graph then just plot(t(1:n),XS(1:n,1),'r',t(n+1:m),XS(n+1:m,1),'b', t(m+1:end),XS(m...

mehr als 5 Jahre vor | 1

Beantwortet
ode45 gave errors
You use S in calculating X, so you need to solve them together, not one after the other. Also ln is log in MATLAB. Try XS0=[2...

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
Please help me with this sequence equation
Firstly t(n+1,i) = 0.46875*t(n,i-1)+0.0625t(n,i)+0.46875(n,i+1); should probably be t(n+1,i) = 0.46875*t(n,i-1)+0.0625*t(n...

mehr als 5 Jahre vor | 0

Beantwortet
ode45 code not producing correct results
The initial value for V is zero, so, because you divide by V in dcdt you get NaNs everywhere. You need to revisit how you calcu...

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
Solving Coupled Differential Equations
More like this perhaps, though the end result is rather boring as your forcing function, F, is all zeros and your initial condit...

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
INVERSE OF A FUNCTION
For a gven target value of y you could write a script along the lines of x0 = initial guess; x = fzero(@fn, x0); function z...

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
Help with plot values
You need to define two different sets of x values. Your matrix solution results in 5 temperatures, so define x = linspace(0,L,...

mehr als 5 Jahre vor | 1

| akzeptiert

Beantwortet
Finding n (the number of dots in base of triangle) using while loop with known triangle nummber (T=120)
t = 1; n = 1; while t<120 n=n+1; t = t+n; end disp(n)

mehr als 5 Jahre vor | 1

| akzeptiert

Beantwortet
Sum values in array according to two criteria (Greater than and less than)
y = sum(x(x>=5 & x<10))

mehr als 5 Jahre vor | 1

| akzeptiert

Beantwortet
Fin heat transfer Matrix
% Construct the matrix % M = [ 1 0 0 0 0; % -1 (2+(m*dx)^2) -1 0 0; % ...

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
How can I solve equation with no explicit solution?
Are you sure your equations are correct? They seem to result in a negative value for t: % First plot graph to see where soluti...

mehr als 5 Jahre vor | 0

Beantwortet
how can I pass the points in which a funtion is evaluated in an integral to a different one?
% I’m not sure I fully understand the system you are trying to model, % but how about using a Monte-Carlo approach to the integ...

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
How to do an equation for multiple variables and data?
Like so >> or = [19.2, 18.8, 19.3]; >> ir = [11.8, 12.2, 11.3]; >> j = (pi/2)*(or.^4 - ir.^4); Notice .^ (ie dot^) not just...

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
How to sum up all 1 values in the matrix until I reach a zero value in the matrix ?
Try this A = [ 1 1 1 0 0 1 1 1 1 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 0 1]; [m, n] = size(A); c=...

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
Fitting Graph Bioprocess Monod
I'm not convinced the equations describe the graphs! I did the following: tspan = 0:250; XSP0 = [0.3660,225,0.00]; [t,XSP]...

mehr als 5 Jahre vor | 0

Mehr laden