Skip to main content
1-Visitor
March 5, 2016
Question

Matrix Programming

  • March 5, 2016
  • 2 replies
  • 2785 views

Hi.....

I have attached a worksheet in Mathcad 15 where I have iterated several functions in finding the parameters of the Gumbel PDF. It works fine when I iterate in succession but my attempt to program the solution doesn't produce the same results.

Cold use some help.

Thanks for any help provided.

Dick..

2 replies

25-Diamond I
March 5, 2016

There were two problems:

1) A program immediately exits when it encounters a return statement. You have the return statement as the last command INSIDE of your loop, so the program exits after the first round - it does not iterate 5 times.

2) Compared to your manual iteration you switched the indices on delta in the last two assignments in the program. Not sure which one is correct.

Regards, Werner

DickCun1-VisitorAuthor
1-Visitor
March 5, 2016

Werner......

Once again.......Thanks so much for your help. I really admire your solutions to discussions because of the simplicity you provide..

Can't thank yo enough.

Dick.....

25-Diamond I
March 5, 2016

Just noticed that the calculation of d in the program is never used and should be omitted. Furthermore its better to move the local function definition of f() outside the loop (or even outside the program.

So it could be

or even

But then - maybe your goal is writing a while-loop instead of the for loop which runs until d is smaller than a certain threshold.

WE

21-Topaz II
July 30, 2016

Without wanting to "usurp" Werner the merit of having solved the problem, I was intrigued to see how the program works.

Gumbel.jpg