Skip to main content
1-Visitor
April 10, 2012
Solved

Programming help - iterating through multiple equations.

  • April 10, 2012
  • 1 reply
  • 4810 views

Hello,

I've attached a mathcad document explaining what I am trying to achieve.

To simply for explanation purposes, I have have a few intial givens:

a b c d

the first equation calculates a number based on the givens.

the second equation calculates the next number based on the first equation

the third equation calculates the next number based on the second equation

the number in the third equation is added to a few of the givens, and the cycle repeats itself.

Could somebody help me write this program?

The mathcad document explains it in more detail.

Thanks!!!!!

Best answer by wayne

I was adding twice, corrected attached.

Fred showed the use of range variable, and Andy improved upon that. If you only want one solution, Andy's is pretty clear and concise.

I showed a different method using a program. It's a little longer, but self contained and can be used to study different conditions a little easier, or used in other functions.

By the way, if a0 and c0 are equal, then I think ci=ai, you only need to calculate ai, so I assume you want to study different inital values.

1 reply

23-Emerald I
April 10, 2012

Set up for step-by step iteration. Probably could set up for ODE solvers.

1-Visitor
April 10, 2012

Fred,

Thanks for the help, however I don't believe the sheet is working correctly. I may be able to fix it myself though - not sure.

da/dN at a phi of 90° should be added to a

da/dN at phi of 0° should be added to c.

I checked it against the attached spreadsheet, and it diverges as the cycles are increased.

What I am trying to do is replicate the attached worksheet, where I can just fill down the row's and it will work just fine.

12-Amethyst
April 10, 2012

Another way, using programs

But Fred and I get different results, so on of us goofed, maybe both.

Not the most efficient program, but you can follow the steps as you stated them (I think )