Community Profile

photo

Alan Stevens


Last seen: Today Aktiv seit 2020

Statistics

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

Abzeichen anzeigen

Content Feed

Anzeigen nach

Beantwortet
Why does integration of an exponential function generate noisy results as opposed to its analytical solution?
You have a singularity when t = x(ii). Here's a rough and ready way to do the numerical integral (hmm! not sure the result is c...

3 Tage vor | 0

| akzeptiert

Beantwortet
Index exceeds the number of array elements. Index must not exceed 1
What are yoy trying to do with x_iEm(i) - h*x_iEm(i) == x_past + h*2*y; when i = 2, there is, as yet, no value assigned to x_...

3 Tage vor | 1

| akzeptiert

Beantwortet
Inconsistent results from "int" function
You can express '(y*(2*x + y)^2)/192 as (x*y*(x + y))/48+y^3/198 As far as the integral is concerned y is a constant, so the t...

5 Tage vor | 2

| akzeptiert

Beantwortet
Boole's Approximation
You are using Boole from -1 to 1, but the "exact" from 0 to pi. (You should plot G against x to see why your "exact" integral w...

8 Tage vor | 1

Beantwortet
I'm trying to solve a system of differential equations using Euler's method, but I don't know what the problem is with my code. If you can correct me the problem
Don't confuse the number 1 with lower case l a= 0; b= 2; delta_x =0.5; y1(1) = 4; y2(1) = 6; n= (b-a)/delta_x + 1 ; x(1)...

8 Tage vor | 0

| akzeptiert

Beantwortet
How to add one sgtitle per row of suplots
Try subplot(2,3,1) scatter(62,VWE3a_diff,50,'MarkerEdgeColor','[0 0 0]','MarkerFaceColor','[0 0.5 1]','Marker','o') title('DM...

12 Tage vor | 0

Beantwortet
How to add one sgtitle per row of suplots
Here's a quick and dirty way: x = 0:0.01:2*pi; for i=1:6 y = sin(x+i*pi/4); subplot(2,3,i) plot(x,y) ...

12 Tage vor | 1

Beantwortet
How do you solve a System of 11 Non-Linear Equations Inter-linked to one another?
Here's a possible logic (though I seem to find negative values for U): U1 = 500; U2 = 500; % Initial guesses U0 = [U1 U2]; ...

14 Tage vor | 0

Beantwortet
Title in maths symbol and title as legend on each plot on different locations.
More like this? %% Set up the data (just enough to need a large legend and to show variety) t = linspace(0, 1, 11); x = linsp...

15 Tage vor | 0

Beantwortet
How to show Kinetic energy,potential energy at given ditance
Do you mean something like this: Tf=20; theta=60; height=5000; angle = 45; g=9.81; velocity=(g*Tf)/(2*sind(theta)); figur...

17 Tage vor | 0

Beantwortet
Summation for every value of "n" (or summation with looping)
Like so: B=7.5; % angle value fn = @(n) (1+2*cos(n*B)).^5/2; n=1:50; Qn = fn(n); Q = sum(Qn); Pr= 395; P1= Pr/Q; disp(P1...

18 Tage vor | 1

| akzeptiert

Beantwortet
Implementing while loop in Heun's Method
Here's a rough and ready way (I'll leave you to implement Heun's method): f = @(H) -0.06*sqrt(H); H = 4; t = 0; dt = 0.1; %...

20 Tage vor | 2

Beantwortet
How to explain a difference in solutions of integrals between MATLAB and MAPLE?
This is what I get in Maple:

22 Tage vor | 0

Beantwortet
I want to put arrows on each of the lines parallel to x-axis using LOOP
Like this? p = 0.02:.07:1; plot([0; 1],[p; p], 'color','b'); hold on %q = 0.2:.2:1; xx = [0.5 0.57]; ...

24 Tage vor | 0

| akzeptiert

Beantwortet
How can I plot this signal?
Like this? gm = 0.04; RL = 10000; CL = 10^(-9); f = logspace(-1,2); Av = (-gm*RL)./(1 + RL*CL*f*1i); %magnitude subplot...

29 Tage vor | 0

| akzeptiert

Beantwortet
Hey so I am trying to code an ellipse and I was confused about the placement of my plot. Should it be before the for loop or after?
Something like this? (I've commented out your meshgrid commands as they just confuse the plot and I'm not at all clear why they ...

30 Tage vor | 1

Beantwortet
Using Euler's Method for projectile motion
A little more like this? (I've used arbitrary values for initial conditions etc.) N = 200; % points to be taken g = 9.8; % acc...

30 Tage vor | 0

| akzeptiert

Beantwortet
need plot a graph using Euler's method for both numerical and analytical
f = a + (2 - 0.4*a) * x(i) / r^2 * pi; % x(i) not just x. % Also take note of the other comments above.

etwa ein Monat vor | 1

Beantwortet
How can I create a loop to show a table with number of iterations and its roots in secant method?
Possibly like this (though using a while loop would be better): f=@(x) exp(0.5*x)+(5*x); x(1)=0.8; x(2)=0.7; tol=0.0001; ...

etwa 2 Monate vor | 0

| akzeptiert

Beantwortet
Condition for output result
Instead of x1 = x0+B; how about x1 = max(min(x0+B,5.0),0);

etwa 2 Monate vor | 0

| akzeptiert

Beantwortet
Why is my loop not ending?
Shouldn't dp(i+1)= ((6*m(i+1))/(pi*row))^(1/3); be dp(i+1)= -((6*m(i+1))/(pi*row))^(1/3); i.e. have a negative sign in front...

2 Monate vor | 0

Beantwortet
Explicit solution can not be found using dsolve of second order differential equation
Do you have a reason to believe there is an analytical solution to this? It is simply solved numerically, as follows: X0 = [1,...

3 Monate vor | 0

| akzeptiert

Beantwortet
i am trying to add a legend for the 0.2% offset line onto the graph, but when i run this, the previous three legend just disappear.
Just put '0.2 offset line' as a fourth item in your other legend command.

3 Monate vor | 0

| akzeptiert

Beantwortet
Minimizing an equation to 0
Try fminsearch

3 Monate vor | 0

Beantwortet
Solving for two variable.
In that case one way is to take logs of both sides to get: log(I) = log(I0) + q/(n*k*T)*U then do a best-fit straight line...

3 Monate vor | 0

| akzeptiert

Beantwortet
I couldn't plot the function because it seems vector length isn't same, please help me in it.
Try changing n = 100 for i = 1:n to n = numel(time); for i = 1:n-1

3 Monate vor | 0

Beantwortet
How to plot an array graph from a 'for' loop?
Try multiplying i by delta_t in the plot command x(1) = 1; delta_t = 0.1; n = 100; for i = 1:n hold on grid ...

3 Monate vor | 1

| akzeptiert

Beantwortet
Display text label on top of grouped bar plots
See answer at your earlier question.

3 Monate vor | 0

| akzeptiert

Mehr laden