# John D'Errico

### Retired

A retired applied mathematician, consultant, sometime mechanical engineer, numerical analyst, woodworker, bridge player. Please DON'T contact me, as too many students then decide I am their personal consultant if I allow it. I won't do consulting by mail.

**Statistics**

RANK**10**

of 295,161

REPUTATION**21,671**

CONTRIBUTIONS

**15** Questions

**7,711** Answers

ANSWER ACCEPTANCE **
46.67%
**

VOTES RECEIVED**4,709**

RANK**4** of 20,180

REPUTATION**65,517**

AVERAGE RATING**4.80**

CONTRIBUTIONS**62** Files

DOWNLOADS **1119**

ALL TIME DOWNLOADS**590880**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**1** Highlight

AVERAGE NO. OF LIKES**8**

**Feeds**

solving a nonlinear equation with complex numbers

syms R positive % positive implicitly implies real also syms X real syms Zo Z=(R*1i*X/(R+1i*X)); r=(Z-Zo)/(Z+Zo) r = simpli...

1 day ago | 0

Warning: Equation is badly conditioned. Remove repeated data points or try centering and scaling.

Do NOT use polynomials to model data like this In fact, do not use high order polynomials, pretty much ever. FR = load('FR.txt'...

3 days ago | 2

Recursively reversing large vector efficiently

An old question with an already good answer. Regardless, it explicitly asks about recursive schemes to flip a vector. And I can ...

4 days ago | 0

Fixing biased random number generation

What is the goal of this? That is a good question, as asked by @埃博拉酱. You should recognize that the result of this operation w...

6 days ago | 0

My end value "tc2" comes out as "NaN + NaNi", in the following script and I cant figure out why.

A NaN means you are doing some operation that has no meaningful result. For example, what is 0/0? 0/0 A mathematician will tel...

6 days ago | 0

Sparse matrix memory understanding

I think you missed a zero. By the way, 5% sparse is NOT at all what I would consider sparse, or for there to often be a gain. L...

9 days ago | 0

Fittype and fit do not work as expected (in a curve fitting)

x = [1 4 9 15 25 35 45 55 65 75 85 95 150 250 350 450 900]; y = [0 335 28 37 9 4 3.5 2 1 0.7 0.6 0.5 0.3 0.1 0.01 0.005 0.001];...

9 days ago | 2

| accepted

Newton Rapson method code question

Actually, this is surprisingly nice looking code. (A true compliment from me, given most of the student codes we see on here!) Y...

14 days ago | 1

| accepted

Converting an STL file to a 3D Surface/Equation

Um, I think you misunderstand a few things. It seems the STL model actually has thickness. So you have exported the entire thi...

14 days ago | 0

I want the genetic algorithm to begin with intial parameter and this is not happened can you help me for making the genetic algorithm begin with the intial parameter?

I think you don't understand GA. It does not use a start point. It starts with an initial population of points from the sample s...

14 days ago | 0

How do I convert a symbolic expression to a string?

Simple enough. Note the changes I made to your last line only. I could also have done it using character vectors, but then I wou...

15 days ago | 1

| accepted

Plotting a volume in 3D

Your question is somewhat incomplete, as to what you mean by plotting a solid volume. I'll assume you may mean something like th...

16 days ago | 0

How to numerically calculate volume under the curve?

You have a surface. (Not a curve as I might say.) How do you compute the area under that surface? Simple. Just call trapz twice....

16 days ago | 1

| accepted

ode45 integration issues for some choices of physical parameters,

This is an absolutely classic case for a stiff system, where for some sets of system parmeters, you have two or more things happ...

18 days ago | 0

How to choose 60 unique coordinates ('A') from 600 coordinates('B'), nearest to 60 other coordinates('C')

As I pointed out to @Voss and @Star Strider, if the points in B mst be unique, then there is an issue. If you simply choose the ...

18 days ago | 1

finding variable of a given equation

gamma is a really bad choice of variable names, since gamma is itself a very useful function in MATLAB. Try to avoid doing these...

20 days ago | 1

solving nonlinear equation using newton method

You just misunderstand how to use the exponential function. In MATLAB, e^x is written as exp(x). That makes your fn as: fn = @...

21 days ago | 0

How to Set a Minimum Step Size for Variables in GA Solver (Global Optimization Toolbox)?

Really easy. Don't think of a step size for the GA solver. It does not take steps anyway, not like fmincon or other solvers of ...

22 days ago | 1

| accepted

Solution of system of nonlinear equations

This will be literally impossible to do in double precision, given the huge dynamic range of those coefficients. But we can look...

23 days ago | 0

Support with interpolation using interp3 in MATLAB

And ... your question about MATLAB is? Far too much vague verbiage to know what is the problem. If you want to know how to use i...

26 days ago | 0

Ode45 g and dg

You cannot use the variable dg4, before it is defined. And we see you do this: dg2=m*A+k*g(1)+h1*k*g(3)+dg4 ... dg4=h1*k2x*g(...

26 days ago | 1

fitting with custom equation

(I assume you intended to write 1/y, and not I/y, where the variable I is not defined.) y = [1.6E5 2.5E5 4.1E5 8E5 1E6 2E6 7E6 ...

27 days ago | 1

improve fit compared to R

x = [0.858734025700000 0.975248753121875 1.02525125312812 1.13140821289062 1.15927407430000 1.18768630564687 1.21665290240...

28 days ago | 1

Some .jpeg photos can not be processed by Matlab code.

I've not even looked at your code. But you have jpg images, uint8 code values. So I wonder if adding the code values caused an o...

29 days ago | 0

Finding concave hull around abstract shape

I don't know the soure of this data. But, can you start with the two pieces as separate entities, form polyshapes from each, and...

29 days ago | 1

Numerical Integration MATLAB vs Python/VBA

This is difficult to say, because we know virtually nothing. First, does the problem arise from the use of subtly different da...

1 month ago | 0

Warning: Explicit solution could not be found./ empty sym

Does an analytical solution exist for EVERY equation you can write down? (No.) Even if such a solution does exist, is it certain...

1 month ago | 0

fmincon is not converge

It is very rarely easy to know why a solver fails to converge on a messy thing like this. But you should never let it come to th...

1 month ago | 0

Is there any way to perform an at least partially symbolic smulation (using ODE or discrete model) in simulink?

Essentially, no. This is a frequent question about tools like ODE45 too. Simulink is a purely numerical tool, like ODE45 and oth...

1 month ago | 0

d solve command matlab

syms e P S A t m V0 t0 V(t) real The point being that assumptions can apply only to variables, not functions. V(t) is a functio...

1 month ago | 0