Will not plot

Support for Rt-Tools 2D Components for Visual Studio 2005 and 2008 WinForms Framework

Moderator: Horst Reichert

Will not plot

Postby rwensley » Mon Jan 18, 2010 12:05 am

Greetings,

I have been using rt-science 2d for some time and find it to be a great program. I have run into a problem however that I can not seem to get past.

Included here is the code I am trying to use (and have used on other projects without difficulty). When I run the project there are no errors or warnings and there is no data plotted.

What am I missing?

Thanks
Ron Wensley

Imports System.Math
Imports RtScience.WinForms

Public Class Valve_Plot

Private Sub Valve_Plot_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Me.lblVLVchar.Text = vlv_characteristics

'temp area to be removed
stroke = 1.75
cvmax = 35
min_flow = 5
max_flow = 100
vlv_characteristics = "Equal Percentage"
' temp area to be removed

Me.liftVector.Clear()
Me.cvVector.Clear()
Me.anti_cvVector.Clear()
Me.flowVector.Clear()

Dim y_temp(100) As Double
Dim cv_plot(100) As Double
Dim flow_plot(100) As Double
Dim lift_plot(100) As Double
Dim temp As Double

Dim xy_grid(20) As xy_data

vlv_R = max_flow / min_flow
vlv_L = (((((((((0.0000000000157142859746465 * (vlv_R ^ 8)) + _
(-0.00000000373986933852068 * (vlv_R ^ 7))) + _
(0.000000376035953017324 * (vlv_R ^ 6))) + _
(-0.0000207732617034981 * (vlv_R ^ 5))) + _
(0.000686286323181805 * (vlv_R ^ 4))) + _
(-0.0138179995088646 * (vlv_R ^ 3))) + _
(0.165126874139673 * (vlv_R ^ 2))) + _
(-1.08000271492705 * vlv_R)) + _
3.37950001439556)

If vlv_characteristics = "Equal Percentage" Then

temp = 0

For x = 0 To 100 Step 5

y_temp(temp) = Round((((temp / 100) / (vlv_L + ((1 - vlv_L) * (temp / 100)))) * 100), 3)
Me.anti_cvVector(temp) = y_temp(temp)

cv_plot(temp) = cvmax * (temp / 100)
Me.cvVector(temp) = cv_plot(temp)

flow_plot(temp) = (cv_plot(temp) / cvmax) * max_flow
Me.flowVector(temp) = flow_plot(temp)

xy_grid(temp) = New xy_data(Convert.ToString(x), y_temp(temp))

temp = temp + 1

Next

temp = 0

For ii = 0 To 100

lift_plot(ii) = temp
Me.liftVector(ii) = lift_plot(temp)

y_temp(ii) = Round((((temp / 100) / (vlv_L + ((1 - vlv_L) * (temp / 100)))) * 100), 3)
Me.anti_cvVector(ii) = y_temp(temp)

cv_plot(ii) = cvmax * (temp / 100)
Me.cvVector(ii) = cv_plot(temp)

flow_plot(ii) = (cv_plot(temp) / cvmax) * max_flow
Me.flowVector(ii) = flow_plot(temp)

temp = temp + 1

Next

Me.lblVLVlin.Visible = True
Me.dgVLVxydata.Visible = True

End If

' Make the control use the array as its data source.
Me.dgVLVxydata.DataSource = xy_grid

' Make column headings.
Me.dgVLVxydata.Columns(0).HeaderText = "X Data"
Me.dgVLVxydata.Columns(1).HeaderText = "Y Data"
Me.dgVLVxydata.Columns(0).Width = 70
Me.dgVLVxydata.Columns(1).Width = 70

End Sub
End Class
rwensley
 
Posts: 2
Joined: Thu Aug 27, 2009 7:31 pm

Re: Will not plot

Postby Horst Reichert » Mon Jan 18, 2010 5:35 pm

Hi Ron,
could you please mail me the complete sample project...

Regards Horst
Horst Reichert
 
Posts: 282
Joined: Fri Apr 15, 2005 9:50 am

Re: Will not plot

Postby rwensley » Tue Jan 19, 2010 1:55 am

Horst,

I sent it to your email.

Thanks for the help.
Ron
rwensley
 
Posts: 2
Joined: Thu Aug 27, 2009 7:31 pm


Return to Rt-Tools 2D for Visual Studio WinForms Framework

Who is online

Users browsing this forum: No registered users and 1 guest

cron