Community Profile

# Alan Stevens

Last seen: Today 2020 年からアクティブ

バッジを表示

#### Content Feed

how to do sensitivity analysis of three variables using MATLAB
Depends what your measure of sensitivity is. One possibility is to do a Monte-Carlo simulation and use the standard error on th...

MATLAB doesn't plot my function
Try fplot(test1)

2日 前 | 0

| 採用済み

I am trying to plot the each value of C at different theta values, but I found an error. Error: Invalid expression. When calling a function or indexing a variable, use parenth
Do you want something more along the following lines? c=[0.5,0.75,1,1.1]; theta=-pi:0.01:pi; %a=zeros(1,629); for k=1:numel(...

3日 前 | 0

Trying to make euler's method program work
Like this: % Arbitrary values here - insert your own x0 = 0; x_end = 10; h = 0.1; y0 = 1; n = fix((x_end-x0)/h)+1; ...

3日 前 | 0

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

9日 前 | 0

| 採用済み

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

9日 前 | 1

| 採用済み

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

11日 前 | 2

| 採用済み

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

14日 前 | 1

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

14日 前 | 0

| 採用済み

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

18日 前 | 0

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

18日 前 | 1

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]; ...

20日 前 | 0

| 採用済み

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

22日 前 | 0

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

23日 前 | 0

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

24日 前 | 1

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; %...

26日 前 | 2

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

28日 前 | 0

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]; ...

30日 前 | 0

| 採用済み

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

| 採用済み

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

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

| 採用済み

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.

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

| 採用済み

Condition for output result

2ヶ月 前 | 0

| 採用済み

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

3ヶ月 前 | 0

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ヶ月 前 | 0

| 採用済み

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ヶ月 前 | 0

| 採用済み

Minimizing an equation to 0
Try fminsearch

3ヶ月 前 | 0