Community Profile

photo

Alan Stevens


Last seen: Today
500 total contributions since 2020

Alan Stevens's Badges

  • 6 Month Streak
  • Knowledgeable Level 4
  • Pro
  • First Answer

View details...

Contributions in
View by

Answered
How to solve a equation iteratively?
Look at the fzero function. Assuming you know P as a function of K, then with an initial guess for K K0 = ...' % initial gue...

ungefär 3 timmar ago | 0

Answered
for loop for variables
You probably want o = 90; not 0 = 90; Also, Matlab indexing starts at 1 not zero, so, perhaps, t = 1:101, then xd(t) = sin(wd*...

ungefär 6 timmar ago | 0

Answered
Fitting gaussian exponential to logscale
The logs of the y values are negative, whereas your function will return positive values only! You are probably better off tryin...

ungefär 6 timmar ago | 1

| accepted

Answered
Trying to code from Polymath
Here's a basic MATLAB version. % Initial conditions Ca0 = 2; Cb0 = 4; Cc0 = 0; Cd0 = 0; T0 = 800; IC = [Ca0 Cb0 Cc0 Cd0...

ungefär 8 timmar ago | 0

Answered
How do you solve the non-growth rate of yeast using non-linear regression analysis?
You can do it as follows. Notice that there are, in effect, only four paramters to fit: x = 0:0.5:5; % mg/L k = [0, 0.22390...

ungefär 8 timmar ago | 1

Answered
can ı plot this chart with a given equation?
Here's a starter. You can add the other equations and labelling V = @(S) 0.349109 + 6.00940*S + 0.047467*S.^2; S = logspace(-...

en dag ago | 1

| accepted

Answered
create tuples of values in array
How about x=[x1,x2,x3,..,xn]; y=[y1,y2,y3,..,yn]; xy = [x; y]; X = xy(1,:); Y = xy(2,:);

en dag ago | 0

Answered
Problems with the legend function.
You might have to change the plot order a little. More like this perhaps: M=1000; x=linspace(-11,15,M); y=linspace(-7,11,M);...

en dag ago | 0

Answered
How can I solve the determinant of large-sized symbolic matrix: det(A)=0?
Set the diagonals of D to be just, u, say. With vpasolve you get 20 numerical values of u almost as quickly as 5. You can then...

en dag ago | 0

Answered
My IF function for a set of data is not working.
You could replace if Da<48 X=32-25*log10(LUA-Y) else X=Grx end by the fol...

en dag ago | 0

Answered
How do i replace Euler's method with ode45?
Here's one way. I've simplified the data input - you can add the bells and whistes! % A script to animate the motion of the sim...

2 dagar ago | 0

Answered
dsolve - Warning: Unable to find symbolic solution.
Why not just solve them numerically: % Parameters tau = 0.138; % dimensionless kinetic parameter delta = 9.9; %...

3 dagar ago | 0

| accepted

Answered
How to increase maximum number of iterations in a 'for' loop, when in the loop?
Use a while loop instead while (norm((x-T),1) > Tolerance) ...etc end

3 dagar ago | 1

| accepted

Answered
Lagrange Interpolating Polynomial Function
Matlab indexing starts from 1 not zero. Also, in array(k) = array(k) * (f(x)-x(i))/(x(k)-x(i)) you should have f(x(i)) not ...

3 dagar ago | 0

Answered
Integrating Acceleration Data Matlab
Try v = cumtrapz(X2(:,1),X2(:,2)); plot(X2(:,1),v)

3 dagar ago | 0

| accepted

Answered
Index exceed matrix dimensions.
Do you just need j = 1; before the last for k=dt:dt:29*dt loop?

3 dagar ago | 0

Answered
Ode45 initial conditions iteration
Like so ... [X Y] = ... for r=1:length(Rad_speed)%freq of harmonic fluctuations, rad/s [t,q]=ode45(duf,Time,[X Y]); [...

4 dagar ago | 0

| accepted

Answered
Outputs of the ode45 is not matching with the known results.
Use tspan = 0:-0.001:-1; to get the correct values for negative values of t.

4 dagar ago | 1

| accepted

Answered
Conditional variables with running ODE45
Yes, but rearrange the coding as follows: tspan = [0:4:200]; y0 = [0.95 0.05 0]; [t,y] = ode45(@(t,y)odefcn(t,y),tspan,y0); ...

4 dagar ago | 0

| accepted

Answered
Index in position 1 is invalid- attempting to perform Laplace's equation
In your loops, 0.1i and 0.1j will result in non integer values for most values of i and j. Indices in T(i,j) etc must be intege...

4 dagar ago | 0

Answered
how to display figures on a plot
str = {['mean_x = ',num2str(mean(x))],...etc} for example. Type: doc num2str in the command window.

4 dagar ago | 0

| accepted

Answered
How to plot h(y/x)? where gamma coefficient =0.5772
Use function expint.

5 dagar ago | 0

Answered
ODE stop integration with imaginary numbers
Are you sure you have the units right here when dMdt <=0? if dMdt > 0 drdt=sqrt(2*g*(h-hmin)); else drd...

5 dagar ago | 0

| accepted

Answered
Resolving a non-linear equations
Do you mean you want to find the value(s) of M that make the function F(M) = 0.8M(1+M^2)-10 equal to zero? If so then use Matla...

6 dagar ago | 0

Answered
Matrix dimension must agree
w is size 1x501 not 1x500.

6 dagar ago | 0

Answered
Finding Solution of an equation with hyperbolic functions within an interval
First draw a graph of the function to see roughly where the roots are, then use fzero: f = @(x) 2*cos(403*x).*sinh(403*x) + 2*...

6 dagar ago | 0

| accepted

Answered
How to plot bifurcation with Delay Differential equations?
How about the following for your loop (it assumed you have defined tau earlier in the file): for j=1:N+1 if t(j)<=tau ...

6 dagar ago | 0

| accepted

Answered
How to use Find (or any other function) to create an Array
Here's another possible way r = repmat((1:9)',1,5); max(r.*S_dash)

8 dagar ago | 1

Answered
Euler's Method and Deflection of Cantilever Beam
Your derivative is incorrect for your specified deflection equation. I think your deflection equation is also not quite right....

8 dagar ago | 0

| accepted

Answered
Runge Kutta 4 method to solve second order ODE
Your integration loop is mightily scrambled. It should be like this x(1) = x0; y(1) = y0; for i=1:length(t)-1 t(i+1) = i*...

8 dagar ago | 0

Load more