Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Plot a Math Function in Visual Basic

Status
Not open for further replies.

saintone1

Technical User
Feb 19, 2002
10
IE
Hi,
I am having trouble plotting a math function in visual basic.
The differential equation is as a follows:
------
dh(t)= -c/2gh(t) 1
---- --------- + -------u(t)
dt A(h(t)) A(h(t))

If anyone knows how to plot a differential equation, even a simple one that would be very helpfull. I am unable to find anything im vb books or on the web on doing this task.
Thanks alot,
Joseph Quinn
 
Strictly speaking, VB doesn't know about plotting 'equations'. The actual plotting is the point (VALUE -dh(t)- in your equation) vs the Variable "t" for each value of "t". I generally solve the equation on a fixed time step and generate the "Plot" from the results. In other situations, you might want to solve the equation for all of the points, saving the results in an array, then use the array as the source of hte points to plot. The advantage of array approach is that the scales do not neeed to be known at design time, and can be computed from the values. Of course, in either approach, you will need to 'trap' various errors and decide what to "Plot" in case of ill mannered equations.

I apologize if this is to basic to help, but I,m not sure I understand the question properly.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top