Community Profile

photo

Alan Stevens


Last seen: Today Attivo dal 2020

Statistiche

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

Visualizza badge

Content Feed

Visto da

Risposto
Solve for x with given equation
Look up the help on function fzero. And don't forget that Matlab doesn't recognise implicit multiplication. x(...) should...

1 giorno fa | 0

Risposto
power method with rayleigh coeff
Make sure you call the function with the arguments in the same order as those defined in the function! A=[4 1 -1 0;1 3 -1 0;-1 ...

2 giorni fa | 0

| accettato

Risposto
Fill area between two vertical curves
Like this: value = [186.7646 198.4115 191.1406 180.8430 175.7136 ... 167.7459 151.2865 144.5964 139.8148 139.4305 188.2865 204...

21 giorni fa | 2

| accettato

Risposto
Simplificar el resultado como valor numerico
Why not simply: p1=[2;3] ; x0_1=@(theta) [cos(theta); sin(theta)]; % =[x1*x0; x1*y0] y0_1=@(theta)[-sin(theta); cos(theta)];...

25 giorni fa | 1

Risposto
Optimizing code for HAC Weight matrix generation - How to be faster?
Try replacing the loops with something like this: i = (1:size(Weight_correlation,1))'; j = 1:size(Weight_correlation,2); c = ...

28 giorni fa | 0

Risposto
How to a create a label at the bottom of a vertical line?
Like this? x = linspace(0,6,100); y = exp(x); plot(x,y) xline(4.5,'-',{'Acceptable','Limit'}, 'LabelVerticalAlignment', 'bot...

circa un mese fa | 0

| accettato

Risposto
Secant method Nan Error
You haven't updated error in your while loop. Try including something like error = abs(X0-X1);

circa un mese fa | 0

| accettato

Risposto
Function error in ODEs RK4 method, solving 6 unknowns
It works for me (I've commented out the fprint statements in the code below - but it works with them in!): global CDin psi thet...

circa un mese fa | 0

| accettato

Risposto
I keep getting the error using '/'.
Try mu_ratio=(1-(vol_frac(c,1)/0.605).*((particle_ratio(c,1)).^1.2)).^(-1.5125); Notice the dots! .* .^ Difficult to be...

circa un mese fa | 0

Risposto
Plateau followed by one phase decay
Like this? x = 0:0.5:20; % time in seconds Y0 = -0.6; % signal baseline value Plateau = -1; % singnal plateu after trigger/st...

circa 2 mesi fa | 1

| accettato

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

2 mesi fa | 0

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

2 mesi fa | 0

| accettato

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

2 mesi fa | 0

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

3 mesi fa | 0

| accettato

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

3 mesi fa | 0

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

3 mesi fa | 0

| accettato

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

3 mesi fa | 1

| accettato

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

3 mesi fa | 0

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

3 mesi fa | 0

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

3 mesi fa | 0

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

3 mesi fa | 0

| accettato

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

3 mesi fa | 0

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

3 mesi fa | 0

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

3 mesi fa | 0

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

3 mesi fa | 0

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

4 mesi fa | 0

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

4 mesi fa | 0

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

4 mesi fa | 0

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

5 mesi fa | 0

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

5 mesi fa | 0

Carica altro