Community Profile

# Alan Stevens

##### Last seen: Today
862 total contributions since 2020

#### Alan Stevens's Badges

View details...

Contributions in
View by

How to get real solutions of a "system of nonlinear equations"?
If you are willing to do the differentiation by hand then the following works % L = 2*x^2 -2*x*y+y^3 + lambda*(x^2 + y^2 -4); ...

alrededor de 4 horas ago | 0

Calling Euler Method to solve Shooting Method
You need to express your 2nd order ode as two 1st order odes y``(x) + 5y`(x) + 4y(x) = 1 v = dy/dx dv/dx = y``(x) So you h...

alrededor de 7 horas ago | 0

solving Diffrential equation one parameter related to another one
Like this? %% Input Parameters Rs = 200; Rr = 180; Phi = 180; t = 0:1:359; e = Rs - Rr; %% Calculation B = @(t) e*co...

alrededor de 7 horas ago | 0

error handling for complex equation
nchoosek(pc-1+iL,pc-1-k) Your value of pc-1-k isn't a non-negative integer, but it needs to be for nchoosk. Also why use s...

1 día ago | 0

merging two ode graphs
Your testode2 function must return a column vector. Try function dy = testode2(~,y) %%% Must return a column vector j=1;bet...

1 día ago | 0

Simulation of differential equations with multiple variables. Biotechnology
You set umax to be 0.33, but then treat it as a function in the definition of f. If umax should simply be multiplied by the oth...

1 día ago | 0

| accepted

How can I keep on rejecting the value of input until the value inputted is greater than 0? Like how can they loop separately until the correct value is input?
Something like: dataX = -1; dataY = -1; while dataX<0 a=input('Please enter the X co-ordinate of the bottom left hand ...

3 días ago | 0

| accepted

How to solve ODE system numerically
help ode45

3 días ago | 1

Solving system of simultanous ODE equations with Multiple Initial conditions
You could try something like: for i = 1:numel(CA0) [t, y]= ode15s(@kinatic3,tspan, [CA0(i) CB0(i) CC0(i)], option); f...

3 días ago | 0

| accepted

Solve an equation like the HP calculator solve
Use fzero. Replace the last line of your code with the following To2fn = @(To2) (1/alfa).*(((To2/p2).*sinh((A*p2)./(2.*To2)))./...

3 días ago | 0

Finding and reporting the variable (Single number) of several with the largest value
Here's one possibility ABC = [0.0076, 0.46, 0.05]; abc = ['A','B','C']; greatestValue = abc(ABC==max(ABC))

4 días ago | 0

Error while solving nonlinear differential equations using ode45
Then this line [t,y0]=ode45(@evapmodel,tspan,y0); should presumably be [t,y0]=ode45(@evapfunc,tspan,y0);

5 días ago | 0

| accepted

Maxwell-Boltzmann Fit with different constant (air-absorption) for each data Point
You could try using fminsearch to estimate B. Something along the lines of: data = % enter your data to be fitted my = % ente...

5 días ago | 0

How can I solve the function numerically for changing Prandtl Numbers ? I couldn't handle this with a for loop inside of a function.
Like this? a = 0; b = 5; N = 1600; eta = (0:0.2:b); numberofeta=length(eta); A = zeros(numberofeta,6); %%%%%%%% B=ones(numb...

6 días ago | 0

| accepted

Plot all if condition with for loop
Do you mean like this: s = 0:0.1:1; for i=1:numel(s) if s(i) > 0 && s(i) <1 %avoid dividing by 0 Z2=sqrt((X.^2)+...

10 días ago | 0

| accepted

How do i solve this equation system?
Try fzero: d1 = 13; g = 9.81; d3 = d1/2; L2 = 72e3; L3 = 40e3; zb = 372; zc = 290; f1 = 0.02; c2 = 89; c3 = 45; w1 = ...

11 días ago | 0

Return function to go back to the beginning of the script
Make the euler routine a function and call it from a while loop. Along the lines of: ... while error>0.1 [h, error] = E...

11 días ago | 0

| accepted

Solve this using MATLAB
Replace F^2 in the first equation using the second equation. This will give you a fifth order polynomial in G. Use the roots f...

12 días ago | 0

Improve Mathworks Euler method
The method is ok, though could be more streamlined, for example: f1=@(x) 5*x+50; f2 =@(x,y) x*10 +10*y; x1=0; y1=0; x2=0; ...

14 días ago | 0

How to solve the problem?
Like this? x=0:.1:2; y=0:.1:2; b=0.5;[X, Y]=meshgrid(x, y); uxy=zeros(size(X)); for a=1:2 m=a^2; pn=(16*m*sinh(pi*Y/2*a...

14 días ago | 1

| accepted

Real solutions to polynomials
Try B = x^6 - x^4/5 + 14*x^2 - 2*x - 10 == 0; b = vpasolve(B,x) C = x^5 - 4*x^3 + 4*x^2 - (4*x)/3 - 10/3 == 0; c = vpasolve(...

15 días ago | 0

Error while performing integration
Like this: x=1:0.1:5; a=5; for i=1:length(x) z(i)=sqrt(a^2-x(i).^2); Q2(i)=quad(@(y) Zdirection(y,x(i),a),0,z(i)); %%%%%%%...

15 días ago | 0

| accepted

how to Number the data points in the scatter plot – in increasing order of X
Here's one way: x=[2.6498, 5.4147, 7.7189, 7.9493, 7.2581, 47.5806, 44.1244, 78.4562, 73.3871, 74.3088, 91.8203, 96.659, 95.967...

18 días ago | 1

| accepted

How to change values for variables that are defined in a equation
More like this perhaps (of course you will need to use your on values for the constants): a = [75, 96.4]; b = [13.8, 14.1]; c...

20 días ago | 0

plotting is giving me multiple lines
A little more like this perhaps: %%%FIBER Ef=220e9;%[N/m] GPA to Newton/square meter Vf=.63; %fiber volume fraction vf=.33;%...

20 días ago | 0

I try to find the air under the curve of this signal
Like this? datacq= load('Acquisition.txt'); datacq(:,1)=datacq(:,1)-datacq(1,1); t=datacq(:,1)*10^-3; accelerationz=abs(data...

21 días ago | 0

| accepted

ode45 second order
Matlab indices start at 1, so you want dy = [y(2); 3.6*sin(t) - 60*y(1) - 5*y(2)];

21 días ago | 0