Answered

how to make a for loop in an ODE 45

More like this I think: data = [0 86; 1 86; 2 117; 6 120; 7 130; 8 135; 13 169; 16 179; 23 224; ... 27 230; 29 242; 36 234...

how to make a for loop in an ODE 45

More like this I think: data = [0 86; 1 86; 2 117; 6 120; 7 130; 8 135; 13 169; 16 179; 23 224; ... 27 230; 29 242; 36 234...

25 dagar ago | 0

Answered

Solve system of equations with 4 + 2N equations

Not entirely clear to me what you want, but perhaps something like the following, where the edge equations are taken outside the...

Solve system of equations with 4 + 2N equations

Not entirely clear to me what you want, but perhaps something like the following, where the edge equations are taken outside the...

25 dagar ago | 0

| accepted

Answered

Turning a function into anonymous function

What do you think is wrong with it? It works ok. Add plot(t,T_an2(t)),grid at the end to see the result.

Turning a function into anonymous function

What do you think is wrong with it? It works ok. Add plot(t,T_an2(t)),grid at the end to see the result.

25 dagar ago | 0

Answered

solving 13 interdependent odes simultaneously by ode45

Well, the following works. I wouldn't know if the results make sense! qgin=12; c_g_in=[1 2 3 4 5 6 ]; c=zeros(13,1); c_l_in...

solving 13 interdependent odes simultaneously by ode45

Well, the following works. I wouldn't know if the results make sense! qgin=12; c_g_in=[1 2 3 4 5 6 ]; c=zeros(13,1); c_l_in...

26 dagar ago | 0

Answered

solving sets of two differential equations using Runge Kutta 4th order code

Here is the corrected version 1: % Solve y'(t)=-2y(t) with y0=3, 4th order Runge Kutta y10 = 3; % Initial Con...

solving sets of two differential equations using Runge Kutta 4th order code

Here is the corrected version 1: % Solve y'(t)=-2y(t) with y0=3, 4th order Runge Kutta y10 = 3; % Initial Con...

26 dagar ago | 0

Answered

Fitting a sum of exponentials to data (Least squares)

Use Matlab's best-fit matrix approach as follows: t=[0.5 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0]; N=[5995 4930 3485 2550 191...

Fitting a sum of exponentials to data (Least squares)

Use Matlab's best-fit matrix approach as follows: t=[0.5 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0]; N=[5995 4930 3485 2550 191...

26 dagar ago | 0

Answered

Matlab solving a system of equations

Parameters, dx, Px, Tx, Mx and Vx can be evaluated simply as follows: a = 1.4; x = -0.5:0.1:0.5; b = 0.153 + x.^2; dx = ...

Matlab solving a system of equations

Parameters, dx, Px, Tx, Mx and Vx can be evaluated simply as follows: a = 1.4; x = -0.5:0.1:0.5; b = 0.153 + x.^2; dx = ...

26 dagar ago | 0

Answered

Question on implementing Jacobi Method

More like this perhaps N=10; % 50; A=gallery('poisson',N); n=size(A,1); xs=ones(n,1); b=A*xs(:); MaxIter=10*n; TOL=1.e...

Question on implementing Jacobi Method

More like this perhaps N=10; % 50; A=gallery('poisson',N); n=size(A,1); xs=ones(n,1); b=A*xs(:); MaxIter=10*n; TOL=1.e...

27 dagar ago | 0

Answered

Trouble plotting solution to two 2nd order ODEs using forward Euler method

The following sorts out your Euler integration: v0=85;%m/s angle=51*pi/180;%rad g=9.81;%m/s^2 m=0.145;%kg r=0.036;%m A=pi*...

Trouble plotting solution to two 2nd order ODEs using forward Euler method

The following sorts out your Euler integration: v0=85;%m/s angle=51*pi/180;%rad g=9.81;%m/s^2 m=0.145;%kg r=0.036;%m A=pi*...

28 dagar ago | 1

| accepted

Answered

vibration of a rod using spectral element method

I don't know if it solves your problem, but your last line should probably have ifft(u2f) not ifft(u2) on the right hand side.

vibration of a rod using spectral element method

I don't know if it solves your problem, but your last line should probably have ifft(u2f) not ifft(u2) on the right hand side.

29 dagar ago | 0

Answered

Not enough input arguments error in function

The following works for me (I['ve chosen random numbers for x as you didn't say what ones you used): x = rand(1,12); y = organ...

Not enough input arguments error in function

The following works for me (I['ve chosen random numbers for x as you didn't say what ones you used): x = rand(1,12); y = organ...

29 dagar ago | 0

Answered

How to merge tow rows in one row?

Like so A = [ 1 2 3 4 5 6 7 8 9 10 11 12]; B = [A(1,:) A(2,:)];

How to merge tow rows in one row?

Like so A = [ 1 2 3 4 5 6 7 8 9 10 11 12]; B = [A(1,:) A(2,:)];

30 dagar ago | 0

Answered

Matlab Numerical integral issue

Your problem occurs when the upper limit of the integration exceeds k0. Are you sure the functions are defined correctly for th...

Matlab Numerical integral issue

Your problem occurs when the upper limit of the integration exceeds k0. Are you sure the functions are defined correctly for th...

30 dagar ago | 0

Answered

Why is an extra line being plotted?

More like this, I think: numFlr=2; Phi_EigVec=[1 3;2 -3;]; y1=zeros(numFlr,1); y2=zeros(numFlr,1); x1=zeros(numFlr,1); x...

Why is an extra line being plotted?

More like this, I think: numFlr=2; Phi_EigVec=[1 3;2 -3;]; y1=zeros(numFlr,1); y2=zeros(numFlr,1); x1=zeros(numFlr,1); x...

ungefär en månad ago | 0

| accepted

Answered

Substitute the value of variable in an equation

Like this, for example: F = @(x,y,a) 3*x.^2*y+4*y.*x.^3+3*a*x; F1 = @(x,y,a) 4*x.*y.^2+3*y; x = 2; a = 3; y = 4; disp(F(...

Substitute the value of variable in an equation

Like this, for example: F = @(x,y,a) 3*x.^2*y+4*y.*x.^3+3*a*x; F1 = @(x,y,a) 4*x.*y.^2+3*y; x = 2; a = 3; y = 4; disp(F(...

ungefär en månad ago | 0

Answered

not geting the plot and my loop is not working

Needs to be as follows: sigma=0.047193; V_tip=180; W=180; Cd_avg=0.01; R=2.235; Rv=80.529; ...

not geting the plot and my loop is not working

Needs to be as follows: sigma=0.047193; V_tip=180; W=180; Cd_avg=0.01; R=2.235; Rv=80.529; ...

ungefär en månad ago | 0

Answered

function reshape creating matrix

"A" only has 11 elements. You want B to have 12 elements (3*4). If you set A = 10:21, for example, it will work.

function reshape creating matrix

"A" only has 11 elements. You want B to have 12 elements (3*4). If you set A = 10:21, for example, it will work.

ungefär en månad ago | 0

| accepted

Answered

tryin analyze a 3d truss

Your matrix "connectivity" has 12 rows, but only 2 columns, yet you are trying to access the third (4'th, 5'th ...12'th) column....

tryin analyze a 3d truss

Your matrix "connectivity" has 12 rows, but only 2 columns, yet you are trying to access the third (4'th, 5'th ...12'th) column....

ungefär en månad ago | 0

Answered

Filling in values of a formula into another formula.

Your equation depends only on t, not x. The following is a modification of your code where I've removed the parameters that are...

Filling in values of a formula into another formula.

Your equation depends only on t, not x. The following is a modification of your code where I've removed the parameters that are...

ungefär en månad ago | 1

| accepted

Answered

ising model ploting problem

You have your plot commands within function "initSpins", which is never called by the coding above it! Also check line 49, wher...

ising model ploting problem

You have your plot commands within function "initSpins", which is never called by the coding above it! Also check line 49, wher...

ungefär en månad ago | 0

| accepted

Answered

Integral Not Calculating Numeric Result

Replace q = int(F,1,2) by q = int(F,1,2,'IgnoreAnalyticConstraints',true)

Integral Not Calculating Numeric Result

Replace q = int(F,1,2) by q = int(F,1,2,'IgnoreAnalyticConstraints',true)

ungefär en månad ago | 0

| accepted

Answered

How to calculate a certain length of mean in a row of data points?

Use reshape to turn the 500000x1 vector into a 50000x10 matrix, then use mean and std on this.

How to calculate a certain length of mean in a row of data points?

Use reshape to turn the 500000x1 vector into a 50000x10 matrix, then use mean and std on this.

ungefär en månad ago | 0

| accepted

Answered

Run and plot complex function

You probably meant to put parentheses in the following line: X=exp(1i*Omega)./exp(1i*Omega)-0.8; Did you mean: X=exp(1i*Omega...

Run and plot complex function

You probably meant to put parentheses in the following line: X=exp(1i*Omega)./exp(1i*Omega)-0.8; Did you mean: X=exp(1i*Omega...

ungefär en månad ago | 0

| accepted

Answered

How to create a 10-by-10 matrix that is all zeros except for ones in the diagonal (runnig from top left to bottom right) using a for-loop?

You can just ue the command eye(10)

How to create a 10-by-10 matrix that is all zeros except for ones in the diagonal (runnig from top left to bottom right) using a for-loop?

You can just ue the command eye(10)

ungefär en månad ago | 0

Answered

How to control the outcome of an ODE?

How about just modifying dydt(5) within the function to % Temperature if y(5)>=600 dydt(5) = 0; else dydt(5) = ( (...

How to control the outcome of an ODE?

How about just modifying dydt(5) within the function to % Temperature if y(5)>=600 dydt(5) = 0; else dydt(5) = ( (...

ungefär en månad ago | 0

| accepted

Answered

Error when solving differential equations

Your function has function dydt = vdpi1(t,y) but you really want dy returned, not dydt.

Error when solving differential equations

Your function has function dydt = vdpi1(t,y) but you really want dy returned, not dydt.

ungefär en månad ago | 0

Answered

not getting plot , why?

Arrange it like this sigma=0.047193; V_tip=180; W=180; Cd_avg=0.01; R=2.235; k=1.1; A=pi*R.^2; P_e= 61147.4; h=0:100:...

not getting plot , why?

Arrange it like this sigma=0.047193; V_tip=180; W=180; Cd_avg=0.01; R=2.235; k=1.1; A=pi*R.^2; P_e= 61147.4; h=0:100:...

ungefär en månad ago | 0