PDA

View Full Version : Advanced Calculus VBA Programming



Skier6
11-05-2007, 11:10 AM
Hello,

I need some help on a problem I'm doing for an Intro to VBA programming class. The question is far above my leval as far as programming where the only thing we've learned is basic loops. functions, arrays and dialogue boxes.

Here is the equation as a bitmap..

apparently I cant post a link sine im a new member but the link is:

http:foward slash foward slash i83 dot photobucket dot com/albums/j313/Saab6/EXTRACREDIT-1 dot jpg

If anyone could be of any help it would be greatly appreciated. BTW, this is an extra credit project and my professor is allowing all outside sources to be used.

Thank you in advance...

TonyJollans
11-05-2007, 12:33 PM
Number one - we don't do homework.

A pointer that may help you, though. Not all the functions you need are native to VBA, but they should all be available as worksheet functions, for example ...

Msgbox WorksheetFunction.Pi()

or, maybe ...

Msgbox WorksheetFunction.tanh(WorksheetFunction.Pi())

or, if not available, easily derivable from those that are available

Skier6
11-05-2007, 01:46 PM
Thank you for your reply. I'm not expecting anyone to do this problem for me but my professor is of no help & and have talked to a friend who has a Masters in Mechanical Engineering and PhD in Mathematics and he could see no way to solve for the n values using paper.

I'm looking for a start please help me..

TonyJollans
11-05-2007, 02:22 PM
I can't read the formula properly on your linked image, but, as a start, I think this will calculate the first term of the numerator in the last set of brackets ...

Dim r1 As Double
Dim r2 As Double
Dim n As Double
Dim theta2 As Double
Dim term1 As Double

With WorksheetFunction
r1 = 0.00075
r2 = 0.0009
theta2 = .Radians(15)
n = 1
term1 = .Tanh((n * .Pi * theta2) / .Log10((r2 / r1) ^ 2#))
MsgBox term1
End With