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

5 years ago | 0

Answered
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 ...

5 years ago | 0

Answered
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 %*********************************************...

5 years ago | 0

Answered
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...

5 years ago | 0

Answered
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]; ...

5 years ago | 0

| accepted

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

5 years ago | 1

| accepted

Answered
ı 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...

5 years ago | 1

| accepted

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

5 years ago | 1

| accepted

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

5 years ago | 0

| accepted

Answered
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...

5 years ago | 0

Answered
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...

5 years ago | 0

Answered
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...

5 years ago | 0

Answered
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) =...

5 years ago | 0

| accepted

Answered
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 ...

5 years ago | 0

Answered
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...

5 years ago | 0

Answered
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...

5 years ago | 1

Answered
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...

5 years ago | 0

| accepted

Answered
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...

5 years ago | 0

Answered
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...

5 years ago | 0

| accepted

Answered
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...

5 years ago | 0

| accepted

Answered
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...

5 years ago | 0

| accepted

Answered
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,...

5 years ago | 1

| accepted

Answered
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)

5 years ago | 1

| accepted

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

5 years ago | 1

| accepted

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

5 years ago | 0

| accepted

Answered
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...

5 years ago | 0

Answered
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...

5 years ago | 0

| accepted

Answered
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...

5 years ago | 0

| accepted

Answered
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=...

5 years ago | 0

| accepted

Answered
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]...

5 years ago | 0

Load more