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

oltre 5 anni fa | 0

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

oltre 5 anni fa | 0

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

oltre 5 anni fa | 0

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

oltre 5 anni fa | 0

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

oltre 5 anni fa | 0

| accettato

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

oltre 5 anni fa | 1

| accettato

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

oltre 5 anni fa | 1

| accettato

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

oltre 5 anni fa | 1

| accettato

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

oltre 5 anni fa | 0

| accettato

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

oltre 5 anni fa | 0

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

oltre 5 anni fa | 0

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

oltre 5 anni fa | 0

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

oltre 5 anni fa | 0

| accettato

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

oltre 5 anni fa | 0

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

oltre 5 anni fa | 0

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

oltre 5 anni fa | 1

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

oltre 5 anni fa | 0

| accettato

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

oltre 5 anni fa | 0

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

oltre 5 anni fa | 0

| accettato

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

oltre 5 anni fa | 0

| accettato

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

oltre 5 anni fa | 0

| accettato

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

oltre 5 anni fa | 1

| accettato

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

oltre 5 anni fa | 1

| accettato

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

oltre 5 anni fa | 1

| accettato

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

oltre 5 anni fa | 0

| accettato

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

oltre 5 anni fa | 0

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

oltre 5 anni fa | 0

| accettato

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

oltre 5 anni fa | 0

| accettato

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

oltre 5 anni fa | 0

| accettato

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

oltre 5 anni fa | 0

Carica altro