Community Profile

photo

Alan Stevens


Last seen: Today Actif depuis 2020

Statistiques

  • 36 Month Streak
  • Guiding Light
  • Knowledgeable Level 5
  • First Answer

Afficher les badges

Content Feed

Afficher par

A répondu
Radiation view factor using Monte Carlo
I think you probably need cos(theta), rather than theta, to be linearly spaced.

10 jours il y a | 0

A répondu
How to fix a syntax in the oscillator's plot code?
Like this (both x_1 and x_2 are contained in y) T0 = 10; omega0 = 1; M = 1; F = 1; x_1 = 0; x_2 = 0; x_0 = [x_1 x_2]; ts...

10 jours il y a | 0

| A accepté

A répondu
ODE45has long runtime and graph will not plot
Here's my attempt to make sense of your equations tauspan = 0:100:10000; % p0 = [0.5 0.5 0 0]; % dp1dt = -rf + rr % dp2...

22 jours il y a | 0

A répondu
Two graphs in the same plot, why?
Something like this data = xlsread('sunHoursInTrollhattan.xlsx'); mins = data(:,1)*60 + data(:,2); plot(1:12, mins,'o'),grid ...

24 jours il y a | 0

| A accepté

A répondu
Two graphs in the same plot, why?
You have the hours as one plot and the minutes as the other! Turn the data into all minutes, or all hours first.

24 jours il y a | 0

A répondu
Could anyone help me in fixing the problem in my code for solving the initial value problem numerically: y'=y^2, y(0)=1?
Here's an attempt using fminsearch. I don't know anything about the Obreschkoff method, so couldn't say if your equations are...

26 jours il y a | 0

| A accepté

A répondu
I get this message(Attempted to access F(5); index out of bounds because numel(F)=4.) when I run the code below..
In fsode you try to use F(7) when calculating F(5), before you have calculated F(7)!

27 jours il y a | 1

| A accepté

A répondu
Laser Rate Equation Modelling
Like this? (Look at lines 27, 28 and 38) %Script % Define model parameters temperature = 25; wavelength = 1.312e...

environ un mois il y a | 0

A répondu
Determine the coordinates of the nodes forming the outermost circle
Here's an alternative way: nodes = importdata("nodes.mat"); figure plot3(nodes(:,1),nodes(:,2),nodes(:,3),'b.','Markersize',1...

environ un mois il y a | 0

A répondu
Problem with fitting a loglog plot
polyfit doesn't like the log of zero. One option is to remove the first row of the data: data_exp_high = load("data_Q_1e-8.txt...

environ un mois il y a | 0

A répondu
Index in position 2 exceeds array bounds (Index must not exceed 1) errors?
N0 is a 4x1 vector, but you call it with two indices in the for loop! Turn N(1,j) into N(1) and similarly for the other calls t...

environ un mois il y a | 0

| A accepté

A répondu
How do I solve this ODE system where there exists derivatives in both sides?
You can separate the terms as follows:

environ 2 mois il y a | 0

A répondu
why am i getting grey figure box can someone fix please
Making some assumptions about your function pendulumODE, I think the following is more like what you expect to see: % Constants...

environ 2 mois il y a | 0

A répondu
Algae growing, concentration curve problem
Increase nt to 10000 and it works just fine for T = 20000.

environ 2 mois il y a | 0

A répondu
Error ''Array indices must be positive integers or logical values.'' when putting interval of 0.01 in a for loop
More like this: k = 0:0.1:2; n = numel(k); for i = 1:n x(i) = k(i); y(i) = k(i)*k(i) + 3*k(i) - 4; end plot(x,y...

environ 2 mois il y a | 0

A répondu
Trying to code from Polymath
Like this for example (I'll leave you to extract the numerical values): Wspan = [0 2]; % Integration range % Initial valu...

environ 2 mois il y a | 0

A répondu
Unable to solve differential equation with finite difference method
Should be more like this I think: b = 0.02; m = 80; L = 0.7; g = 9.81; J = m * L^2/3; a = 0; bet = 2; alpha = 0; beta = 3...

2 mois il y a | 0

A répondu
FDM using succsesive overrelaxation method,
For w1 and T1 you have w1(:,Nx1+1) = (((la*B1*dx1)/(dx2*A1))*(w2(:,2)-w2(:,1)))+w1(:,Nx1); %Continuity of shear stress ...

2 mois il y a | 0

A répondu
Solving first order ODE with initial conditions and symbolic function
You can do it numerically as follows: % input parameters Tinf=70+273.15; Ti=20+273.15; d=15e-2; r=d/2; cdepth=10/1100; Tf...

3 mois il y a | 0

A répondu
can someone help me to analyze this program? How does the flowchart look like?
Perhaps this will help: %radiasi benda hitam % constants h=6.626e-34; c=3e8; k=1.38066e-23; % range of values lambda ...

3 mois il y a | 0

A répondu
Error using surf (line 71) Data dimensions must agree
More like this? for it=1:2 for jt=1:3 zt(it,jt)=it+(jt-1); end end [x,y] = meshgrid(1:3,1:2); figure; surf(x...

3 mois il y a | 1

A répondu
How to find Basins of attraction for the Halley method?
Don'tforget the dot multiply: f = @(z) z.^3 +1; df = @(z) 3*z.^2; ddf=@(z) 6*z; % its roots r1 = -1; r2 = 1/2 + 1i*...

4 mois il y a | 0

| A accepté

A répondu
"Invalid use of operator." doesn't go even after trying various solutions :(
Why nor just use Matlab's inbuilt cart2pol function?

4 mois il y a | 0

A répondu
Heat equation using Boundary condition
function statements of this form (i.e. functions eq1, initial and ba) need to go at the end of the script, not the start.

5 mois il y a | 0

A répondu
A for loop that will run until a specific mathematical value is found
You could try replacing the "for i = 2:10 " loop by something like nports = 1; while Q(i)<Qdesired nports = nports ...

5 mois il y a | 0

| A accepté

A répondu
How to plot all figures in only one plot?
Here's one simple way: x=-pi:0.1:pi; c=-6:5; figure hold on for i=1:length(c) y=c(i)*x.^(2)+4*x+2; plot(x,y) end...

6 mois il y a | 0

| A accepté

A répondu
Error in Hermite Polynomial
In line for j = 0:i-1 you have j starting at zero. Matlab's indices start at 1, so the following line should have X(j+1) not ...

6 mois il y a | 0

A répondu
Matlab code not computing
The use of square brackets in the scatter function is not the only problem! Are you looking for something like this? p=-1; z=...

7 mois il y a | 0

| A accepté

A répondu
how to plot the path of circular beam oscillation welding?
Like this? A=1; f=50; vf=0.02; time = linspace(0,100,500); x0 = vf*time; theta = 2*pi*f*time; x=A*cos(theta)+x0; y=A*sin...

8 mois il y a | 0

Charger plus