Answered

Graphing partial sums of harmonic fourier series

x = (linspace(-2,4,200)).'; n = 1:5; f = 1 - exp(-1) + 2*sum((1-(-1).^n*exp(-1))./(1+n.^2*pi^2).*cos(n.*pi.*x),2); plot(x,f) ...

Graphing partial sums of harmonic fourier series

x = (linspace(-2,4,200)).'; n = 1:5; f = 1 - exp(-1) + 2*sum((1-(-1).^n*exp(-1))./(1+n.^2*pi^2).*cos(n.*pi.*x),2); plot(x,f) ...

3 días ago | 0

Answered

Help using fmincon to find the 2 support locations (x1,x2) that minimize maximum bending moment

Don't know if the bending moment is correctly implemented. From how I naively interpreted the problem, x1 and x2 should lie symm...

Help using fmincon to find the 2 support locations (x1,x2) that minimize maximum bending moment

Don't know if the bending moment is correctly implemented. From how I naively interpreted the problem, x1 and x2 should lie symm...

3 días ago | 0

Answered

Resultant vector from three different location and normal vector of a plane

v1 = [0.000326 -0.00018 -0.00017 ]; v2 = [0.000365 -0.00016 -0.00017 ]; v3 = [-0.00015 -0.00018 -0.00039 ]; % compute r...

Resultant vector from three different location and normal vector of a plane

v1 = [0.000326 -0.00018 -0.00017 ]; v2 = [0.000365 -0.00016 -0.00017 ]; v3 = [-0.00015 -0.00018 -0.00039 ]; % compute r...

3 días ago | 2

| accepted

Answered

Finding the function of the supremum

sup-norm is a theoretical concept. There is no such function in MATLAB to calculate it for a general function. In the case abo...

Finding the function of the supremum

sup-norm is a theoretical concept. There is no such function in MATLAB to calculate it for a general function. In the case abo...

4 días ago | 1

| accepted

Answered

How to generate an exponential random variable parameter 1?

https://de.mathworks.com/help/stats/exprnd.html

How to generate an exponential random variable parameter 1?

https://de.mathworks.com/help/stats/exprnd.html

4 días ago | 0

Answered

How to write a script to test central limit theory

rng('default') n=10; r=sum(randi(6,1000,10),2); m=mean(r); s=std(r); hold on histogram((r-m)/s,15,'Normalization','pdf') ...

How to write a script to test central limit theory

rng('default') n=10; r=sum(randi(6,1000,10),2); m=mean(r); s=std(r); hold on histogram((r-m)/s,15,'Normalization','pdf') ...

4 días ago | 0

Answered

how to define a matrix element in matlab

A=[1 2; 3 4]; B=[5 6; 7 8; 9 1; 1 4]; B(1:2,1:2) = A; B

how to define a matrix element in matlab

A=[1 2; 3 4]; B=[5 6; 7 8; 9 1; 1 4]; B(1:2,1:2) = A; B

5 días ago | 0

Answered

Can i fix a sum of vector generated by Distribution Poisson?

Fix the random seed: https://de.mathworks.com/help/matlab/ref/rng.html rng('default') % e.g. lambda = 1/7; v = poissrnd(la...

Can i fix a sum of vector generated by Distribution Poisson?

Fix the random seed: https://de.mathworks.com/help/matlab/ref/rng.html rng('default') % e.g. lambda = 1/7; v = poissrnd(la...

5 días ago | 0

| accepted

Answered

Create a loop that performs calculation on 100 rows and moves to the next 100 rows in a matrix.

n = 100; m = 11700/n; dc = zeros(m,1); for count = 1:m M = q((count-1)*n+1:count*n,:); summe = 0.0; for i = 1:...

Create a loop that performs calculation on 100 rows and moves to the next 100 rows in a matrix.

n = 100; m = 11700/n; dc = zeros(m,1); for count = 1:m M = q((count-1)*n+1:count*n,:); summe = 0.0; for i = 1:...

5 días ago | 0

| accepted

Answered

LSQcurvefit does not yield same result for comparable data sets

Use x4 = [-2.1782 5.0283 2.1782 720.8491]; instead of x4 = [1 1 1 0]; as initial guess for the parameters.

LSQcurvefit does not yield same result for comparable data sets

Use x4 = [-2.1782 5.0283 2.1782 720.8491]; instead of x4 = [1 1 1 0]; as initial guess for the parameters.

5 días ago | 1

| accepted

Answered

generating random no. between -pi to pi

See the example Random Numbers within Specified Intervals under https://de.mathworks.com/help/matlab/ref/rand.html

generating random no. between -pi to pi

See the example Random Numbers within Specified Intervals under https://de.mathworks.com/help/matlab/ref/rand.html

5 días ago | 1

Answered

How can I solve 4 simultaneous equations ?

You might want to test fsolve and lsqnonlin with different initial guesses for the parameters, but I doubt you will find a sol...

How can I solve 4 simultaneous equations ?

You might want to test fsolve and lsqnonlin with different initial guesses for the parameters, but I doubt you will find a sol...

5 días ago | 0

| accepted

Answered

BVP4C for solving an 3rd order ODE

tmesh = linspace(0,10,100); solinit = bvpinit(tmesh, [0 1 0]); sol = bvp4c(@odefun, @bcfcn, solinit); plot(sol.x, sol.y) f...

BVP4C for solving an 3rd order ODE

tmesh = linspace(0,10,100); solinit = bvpinit(tmesh, [0 1 0]); sol = bvp4c(@odefun, @bcfcn, solinit); plot(sol.x, sol.y) f...

5 días ago | 1

| accepted

Answered

Find the polar representation of (𝑖 − √3 )

https://de.mathworks.com/help/matlab/ref/cart2pol.html

Find the polar representation of (𝑖 − √3 )

https://de.mathworks.com/help/matlab/ref/cart2pol.html

5 días ago | 0

Answered

Help with time dependent ODE with a piece-wise component that needs to mirror a convolution integral

tspan1 = 0:0.01:0.2; odefcn1 = @(t,y) [y(2); -(1500.*y(1) - 1500.*(2.5.*t))./5]; y0_1 = 0; ydot0_1 = 0; ics1 = [y0_1 ydot0_1...

Help with time dependent ODE with a piece-wise component that needs to mirror a convolution integral

tspan1 = 0:0.01:0.2; odefcn1 = @(t,y) [y(2); -(1500.*y(1) - 1500.*(2.5.*t))./5]; y0_1 = 0; ydot0_1 = 0; ics1 = [y0_1 ydot0_1...

5 días ago | 0

Answered

I need help to execute a triple integral

You still didn't get the point. Look at the documentation of integral3: q = integral3(fun,xmin,xmax,ymin,ymax,zmin,zmax) appro...

I need help to execute a triple integral

You still didn't get the point. Look at the documentation of integral3: q = integral3(fun,xmin,xmax,ymin,ymax,zmin,zmax) appro...

5 días ago | 1

| accepted

Answered

How to solve differential equation including derivative of eigenvalue of tensor?

A third variante of the code also seems to work under MATLAB ( for high values of the integration tolerances :-) ) syms s A = ...

How to solve differential equation including derivative of eigenvalue of tensor?

A third variante of the code also seems to work under MATLAB ( for high values of the integration tolerances :-) ) syms s A = ...

6 días ago | 0

Answered

The (x,y) coordinates of a certain object as a function of time t are given by x(t) = 5t - 10; and y(t) = 25t2 – 120 t + 144, for 0 ≤ t ≤ 4. 1)

syms t x = 5*t-10; y = 25*t^2-120*t+144; distance_squared = x^2+y^2; d_distance_squared_dt = diff(distance_squared,t); time...

The (x,y) coordinates of a certain object as a function of time t are given by x(t) = 5t - 10; and y(t) = 25t2 – 120 t + 144, for 0 ≤ t ≤ 4. 1)

syms t x = 5*t-10; y = 25*t^2-120*t+144; distance_squared = x^2+y^2; d_distance_squared_dt = diff(distance_squared,t); time...

6 días ago | 1

| accepted

Answered

plotting a graph in a range

R = 2.303 * 8.314; F = 96500; ratio = @(T,eqv,z) exp(eqv*(z*F)./(R*T)); T = 283:313; plot(T, ratio(T,-0.06,1))

plotting a graph in a range

R = 2.303 * 8.314; F = 96500; ratio = @(T,eqv,z) exp(eqv*(z*F)./(R*T)); T = 283:313; plot(T, ratio(T,-0.06,1))

6 días ago | 0

| accepted

Answered

Array indices must be positive integers or logical values.

Everywhere where you want to multiply two quantities, you must set the multiplication sign. Something like r1 = k1(xch4*xh2o*P...

Array indices must be positive integers or logical values.

Everywhere where you want to multiply two quantities, you must set the multiplication sign. Something like r1 = k1(xch4*xh2o*P...

6 días ago | 0

Answered

How do I solve a triple integral with one integral limit in function of another variable

beta1= 1.72; mo1=5; rmin1=10; rmax1 = 20; mmax1 = 10; fun=@(r,m,s) r.*exp(-(s.^2/2 + beta1*(m-mo1)))./sqrt(r.^2-rmin1); z...

How do I solve a triple integral with one integral limit in function of another variable

beta1= 1.72; mo1=5; rmin1=10; rmax1 = 20; mmax1 = 10; fun=@(r,m,s) r.*exp(-(s.^2/2 + beta1*(m-mo1)))./sqrt(r.^2-rmin1); z...

7 días ago | 1

Answered

2D Temperature distribution from 1D temperature distribution T(x)

x_position = [0.05; 0.0625; 0.075; 0.0875; 0.10; 0.1125; 0.125; 0.1375; 0.15; 0.1625; 0.175; 0.1875; 0.2; 0.2125; 0.225; 0.2375...

2D Temperature distribution from 1D temperature distribution T(x)

x_position = [0.05; 0.0625; 0.075; 0.0875; 0.10; 0.1125; 0.125; 0.1375; 0.15; 0.1625; 0.175; 0.1875; 0.2; 0.2125; 0.225; 0.2375...

7 días ago | 0

| accepted

Answered

How to solve differential equation including derivative of eigenvalue of tensor?

Here is a numerical code to solve your problem. It's risky to use this approach since - as Walter Roberson noted - the ordering...

How to solve differential equation including derivative of eigenvalue of tensor?

Here is a numerical code to solve your problem. It's risky to use this approach since - as Walter Roberson noted - the ordering...

7 días ago | 1

Answered

y(k + 2) = 0.25y(k), y(0) = 0, y(1) =1 (b). Write a Matlab script that solves y(k) pointwise for k =0,1,2,…,10. Ruun the program and verify that the solution is in accordance

Initialize y(1) = 0, y(2) = 1 and use a for-loop to calculate y(k+2) starting with k = 1 and ending with k = 9.

y(k + 2) = 0.25y(k), y(0) = 0, y(1) =1 (b). Write a Matlab script that solves y(k) pointwise for k =0,1,2,…,10. Ruun the program and verify that the solution is in accordance

Initialize y(1) = 0, y(2) = 1 and use a for-loop to calculate y(k+2) starting with k = 1 and ending with k = 9.

7 días ago | 0

Answered

How to solve coupled second order ODE?

b = 0.1; fun = @(t,y)[y(2);-b*y(2)*sqrt(y(2)^2+y(4)^2);y(4);-b*y(4)*sqrt(y(2)^2+y(4)^2)]; y0 = [0;44.5;80;0]; tspan = [0,10];...

How to solve coupled second order ODE?

b = 0.1; fun = @(t,y)[y(2);-b*y(2)*sqrt(y(2)^2+y(4)^2);y(4);-b*y(4)*sqrt(y(2)^2+y(4)^2)]; y0 = [0;44.5;80;0]; tspan = [0,10];...

7 días ago | 0

Answered

Getting the summation of a series

h=[ 1 3 5 7 9 11 13 15] ; ah = [35.8577 -6.2962 -1.2855 3.9251 -3.8197 2.2690 -0.4077 -0.9397 ]; alpha = lins...

Getting the summation of a series

h=[ 1 3 5 7 9 11 13 15] ; ah = [35.8577 -6.2962 -1.2855 3.9251 -3.8197 2.2690 -0.4077 -0.9397 ]; alpha = lins...

7 días ago | 1

| accepted

Answered

Using fminsearch() for MSD system

p0 = [50 400]; p = fminsearch(@fun,p0) function objective = fun(p) k2 = p(1); c2 = p(2); %tspan = [0,0.3]; %observing sys...

Using fminsearch() for MSD system

p0 = [50 400]; p = fminsearch(@fun,p0) function objective = fun(p) k2 = p(1); c2 = p(2); %tspan = [0,0.3]; %observing sys...

8 días ago | 0

| accepted

Answered

Create a unit vector from two locations?

is this correct? No. MTH2 = [0.472 1.364 0.06] CoM = [0.471 1.147 0.903] UnitVector = (CoM - MTH2) / norm(CoM - MTH2)

Create a unit vector from two locations?

is this correct? No. MTH2 = [0.472 1.364 0.06] CoM = [0.471 1.147 0.903] UnitVector = (CoM - MTH2) / norm(CoM - MTH2)

8 días ago | 0

Answered

how to use derivative of function using gradient?

Forget about y(13) and use dydz(2) = y(3); %Specific mass balance (CH4) dydz(3) = ((y(1)*y(3))+(dens_cat_weighted*r_CH4))/(D_m...

how to use derivative of function using gradient?

Forget about y(13) and use dydz(2) = y(3); %Specific mass balance (CH4) dydz(3) = ((y(1)*y(3))+(dens_cat_weighted*r_CH4))/(D_m...

8 días ago | 1

Answered

How to solve differential equation including derivative of eigenvalue of tensor?

See if it works. I cannot test it. syms s A = sym('A',[3 3]); % Define characteristic polynomial determinant = det(A-s*eye(3...

How to solve differential equation including derivative of eigenvalue of tensor?

See if it works. I cannot test it. syms s A = sym('A',[3 3]); % Define characteristic polynomial determinant = det(A-s*eye(3...

8 días ago | 1