Community Profile

photo

Alan Stevens


Last seen: en dag ago Active since 2020

Statistics

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

View badges

Content Feed

View by

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

4 dagar ago | 0

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

15 dagar ago | 0

| accepted

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

16 dagar ago | 0

| accepted

Answered
Minimizing an equation to 0
Try fminsearch

16 dagar ago | 0

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

17 dagar ago | 0

| accepted

Answered
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

19 dagar ago | 0

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

20 dagar ago | 1

| accepted

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

20 dagar ago | 0

| accepted

Answered
Solving coupled second order differential equations
Something like this? m1 = 10; m2 = 20; c = 30; k = 5; tspan = [0 1]; ic = [...

21 dagar ago | 0

| accepted

Answered
How to create an objective function c(t) to use fminserch , struggle with the summatoin , i used the following code for the optimization but it doesn't seem to work
Do you mean something like this: KT0 = [1, 10]; % initial guesses [KT, C] = fminsearch(@FN, KT0); K = KT(1); T = KT(2); d...

28 dagar ago | 1

Answered
Generate diagram in linear scale
See help polyval

28 dagar ago | 0

Answered
error bar on group plot :X-data must be the same size as Y-data.
Something like this? % Set up the problem by recreating the table. A = [ 0 0 1 1 2 2 3 3]'; B = ['0' '1' '0' '1' '0' '1' '0' ...

ungefär en månad ago | 0

| accepted

Answered
Improving fit of data to sum of cosines model
Try changing the dihedral angles to radians (or change cos to cosd in expr).

ungefär en månad ago | 0

Answered
Solving 2d laplace equation with insulation ,,,,, code won't work because the error doesn't get below 1 neeeed help
Like this? m=7; n=9; L=40; H=30; dx=L/(n-1); dy=H/(m-1); x=0:dx:L; y=0:dy:H; lamda=1.5; epsilon=1e-4; %% T=zero...

ungefär en månad ago | 0

Answered
I want to do stop condition which demand dx=0 in coupled differential equations
You could do something like the following (doesn't actually stop the integration, but only plots the relevant bit): alpha=0.5; ...

ungefär en månad ago | 0

Answered
Energy balance of stirred tank
Try doc ode45

ungefär en månad ago | 0

Answered
Increasing number of data points by linear interpolation method
Try doc interp1

ungefär 2 månader ago | 0

Answered
I have two 4x4 matrices. I sub-divided these matrices in 4 2x2 matrices each. Now I want to compare these 2x2 matrices.
Something like this: M1 = [8 7 6 9; 11 13 4 21; 2 69 33 27; 5 3 1 8]; M2 = [0 1 0 1; 1 0 1 0; 0 1 0 1; 1 0 1 0]; M = M1.*M2...

ungefär 2 månader ago | 0

| accepted

Answered
Solving inter-connected ODE equations
The answer is Yes. You have a system of 9 ODE's. Try help ode45 for details on how to do it.

ungefär 2 månader ago | 0

Answered
support vector regression - Coefficient of Determination
Have a look at: https://uk.mathworks.com/matlabcentral/fileexchange/34492-r-square-the-coefficient-of-determination?s_tid=srcht...

ungefär 2 månader ago | 0

Answered
Value of infinite integral is different
The value of your integral is infinite! Are you sure you have written the function S correctly?

ungefär 2 månader ago | 0

Answered
Evaluating the following integral using comp trap method for 2 trapezoids
You need to divide by the true value of the integral in calculating the error: y = @(x) (10 - 2*cos(x)); b= pi/3; a = 0; ...

ungefär 2 månader ago | 0

Answered
How to Use Nested For Loops to Create a Coupled System of Equations
More like this perhaps (you've very tight tolerances!): options = odeset('RelTol',3e-14,'AbsTol',1e-15,'Stats','on'); [t,y]=od...

ungefär 2 månader ago | 0

| accepted

Answered
Solving Trigonometric Equations with More Than One Variables
You have theta = 30degrees, so sin(theta) is 1/2. Therefore, in equation 2, you have cos(psi)/2 = 0.76, so cos(psi) > 1. If ...

ungefär 2 månader ago | 0

Answered
Plot 2D surf from 3 columns (X, Y, Data)
plot3 will plot your points as a line (or series of points). To get a surface, set up regular coordinates over the appropriat...

2 månader ago | 1

Answered
I want to plot v/vth as a function of y(where y varies from [0 d] and d=6)
The integral is infinite if you let phi go all the way to phim. If you restrict the upper limit of the integral to be less than...

2 månader ago | 1

| accepted

Answered
4th order runge-kutta method to solve two 1st order differential equations
Like this? %%4th order runge-kutta for Project 2 fy=@(t,y,z) z; fz=@(t,y,z) (36000/(1500-40*t))-9.81-((0.1962*z^2)/(1500-40*t...

3 månader ago | 0

| accepted

Answered
How to convert this equation to code?
Use ^ not **

3 månader ago | 1

Answered
need help with mass transfer modelling
Here's one way of doing it: % You need to do the time integration for each C separately C = 150:50:250; % Choose your own ...

3 månader ago | 1

Answered
Function of a variable
You need to define sc before using it in B. In B you have ...1000/dref*dref.... This just means the dref va;lues cancel each ...

3 månader ago | 0

Load more