Help needed with this program
Hello,
I would like to enquire on whether this VI has any error. I need to configure the digital input as a positive limit switch which is a sensor which when blocked, will produce a change in the voltage pulse.
Attachments:
sensor.vi 34 KB
Hello,
I could not open. Can you save it for LabView 8.2 or 8.5?
Andy
Best Regards,
Andy
PCI-7356@UMI7764; PCIe-6320@SCB-68; LV2011; Motion Assistant 2.7; NI Motion 8.3; DAQmx 9.4; Win7
Similar Messages
-
Help needed with this form in DW
Hi, i have created this form in dreamweaver but ive got this problem.
In the fields above the text field, the client needs to fill in some info such as name, email telephone number etc.
But the problem is when ill get the messages. Only the text from the large text field is there.
What did i do wrong??
http://www.hureninparamaribo.nl/contact.html
Thank you
Anybody??Thank you for your response. So what do i have to do to fix this?
Date: Sun, 20 Jan 2013 07:57:56 -0700
From: [email protected]
To: [email protected]
Subject: Help needed with this form in DW
Re: Help needed with this form in DW
created by Ken Binney in Dreamweaver General - View the full discussion
You have several duplicate "name" attributes in these rows which also appears in the first row
Telefoon:
Huurperiode:
Aantal personen:
Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5008247#5008247
Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5008247#5008247
To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5008247#5008247. In the Actions box on the right, click the Stop Email Notifications link.
Start a new discussion in Dreamweaver General by email or at Adobe Community
For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746. -
Can someone help me with this program?
Can someone make this program for me?
Make a Java-webapplication containing a few webpages (html-files and servlets, but NO jsp's). With this application you can get bankdata from a database, for example:
page 1: html-file: Welcome on the website, type your bankaccount and password
page 2: error if bankaccount doesn't exist or wrong password
page 3: welcome with name and option to choose for your balance or a list with transactions from that account (the user can give a starting date)
page 4: showing the balance or the list with transactions, name and accountnumber
Store the information about the account and name in sessionsvariables
the database is an access-file with two tables
table Accounts with colums: accountnumber, name, balance and password
table Transactions with colums: accountnumber, amount, plus/minus, date, sorttransaction and contra-account
(when I need to send you the database by mail, you can ask me ...)
maybe someone can help me,
thanks in advance
greetings BastiaanSure we can help you. Post the code you have already and explain any problems you are currently having together with any and all complete compiler error messages and/or exceptions.
But no, we are not going to do your homework for you. -
Pls help me with this program - urgent
Hi,
I am new to Java. First time to do the program. Stuck here.
The description of the program:
Implement a complex number (numbers of the form a+ib, where i2 = -1, i2 is i raised to power 2 ). Recall that a complex number consists of a real part (a) and an imaginary part (b). Provide a reasonable set of constructors; the methods add, subtract, multiply and divide; as well as toString and equals.
You are to implement a complex number as having two fields, one for the real part another for the imaginary part.
If z = a + ib and x = c + id are two complex numbers, then their sum z+ x = (a+c) + i(b+d), quotient z/x = (ac+bd)/(c*c+d*d) + i(-ab+bc)/(c*c + d*d). two complex numbers are equal if their real and imaginary parts are equal.
I really do not have any clues about imaginary parts and how to do it.
Could you please help me with that.
Thanks a lot.ur dboubt has nothing to do java.. its a mathematical concept..
as the question says the complexnumbers can be represented in the form of a+ib where i=squre-root of -1 .. and as this is imaginary (ie u cant get a minus number by squring a number) the second part is called imaginay.
so as a programmer u dont have to give more strain on this but to declare a class having to instance varaiables and inplememts the methods as said.
and in the toString() method u can return the numbers in the reuired format like
return ( a + "+i" +b); -
Help needed with basic program
I am working on an assignment for my java class, and I am stuck. This is the 1st programming class that i have taken and am a little confused. I am supposed to write a program that inputs 5 numbers and determines and prints the number of negative numbers, positive numbers, and zeros that were inputed. I have gone about this a few different ways so far... but I'm not really sure what to do...
This is what I have so far on my latest attempt, which I think might be completely wrong..... HELP!!!
import java.util.Scanner;
public class test
public static void main (String[] args)
Scanner input = new Scanner (System.in);
int integer
int negative = 0;
int positive = 0;
int zero = 0;
int studentCounter = 1;
while (studentCounter <=5)
System.out.print("Please enter an integer:");
integer = input.nextInt();
if (integer == 0
zero = zero +1
I also tried something similar using :
int num1; //first number input
int num2; //second number input
int num3; //third number input
int num4; //forth number input
int num5; //fifth number input
System.out.print ("Enter first integer:"); //prompts for input
num1 = input.nextInt();
System.out.print ("Enter second integer:"); //prompts for input
num2 = input.nextInt();
System.out.print ("Enter third integer:"); //prompts for input
num3 = input.nextInt();
System.out.print ("Enter forth integer:"); //prompts for input
num4 = input.nextInt();
System.out.print ("Enter fifth integer:"); //prompts for input
num5 = input.nextInt();
but i didn't know what to do next.....import java.util.Scanner;
ublic class test
public static void main (String[] args)
Scanner input = new Scanner (System.in);
int integer
int negative = 0;
int positive = 0;
int zero = 0;
int studentCounter = 1;
while (studentCounter <=5)
System.out.print("Please enter an integer:");
integer = input.nextInt();
if (integer == 0
zero = zero +1
This looks more or less correct so far. Not ideal, but aside from a missing ) and the fact that you trailed off without finishing, it looks like you're on track.
Start with this, and post details about what specific problems you're having.
When you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read. -
Help needed with this tutorial please
Hello in this InsertUpdateDelete tutorial at:
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/index.jsp
or
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/inserts_updates_deletes.html
and in this paragraph:
Changing the Column Components
and this statement
In the Visual Designer, select the top Drop Down List component in the Table.
"It's pretty confusing because there isn't a Drop Down List component in the Table as far as i can tell. There is a Drop Down List on the canvas up above this data table, but that has already been bound in a previous process, here is that previous proces:"
Configuring the Drop Down List
Select the Drop Down List in the Visual Designer and, in the Properties window, change its General > id property to personDD.
Right-click the personDD Drop Down List in the Visual Designer and choose Bind to Data from the pop-up menu. The Bind to Data dialog box appears.........
Can anyone tell me where i can get help with this tutorial or where i can download the finished program so i can sync up with what is actually being referenced in the questional statement that i mentioned above please?
Thanks very much!
BobKIn Step 5 of "Changing the Column Components" you change the Trip Type column to a drop-down list.
5. Select TRIP.TRIPTYPEID from the Selected list and make the following changes:
* Change the Header text field from TRIPTYPEID to Trip Type.
* Using the drop-down list, change the Component Type from Static Text to Drop Down List.
6. Click OK to enforce your changes and dismiss the window. If the table columns are too wide after performing the above steps, you can resize them by selecting the first component in each column and dragging its selection handles.
7. In the Visual Designer, select the top Drop Down List component in the Table. Right-click and choose Bind to Data from the pop-up menu. The Bind to Data dialog box opens. -
Help needed with this scenario
Hi,
This is a scenario to be implemented using workflows.
Can you tell me how to go about with this.
there is a form on the portal. User enters some details there. Then there is a submit button. when the user presses the submit button, a workflow is triggered on the R/3 side. A work item is sent to the manager which has a form ( the form's layout and data are the same as that of the portal screen ). Basically whatever the user enters in the portal screen is sent as a form to his manager, who can then approve it or reject it.
Can anyone tell me how this can be done.....the general steps...connectivity between portal and R/3 workflowHi Vijay,
If you are on R3 Enterprise or above, you can crate a BSP application to get user data and create an iview for this BSP Application. Within BSP application you can use "SWJ_WAPI_START_WORKFLOW" to trigger the workflow.
Cheers,
Sanjeev -
Can anyone help me with this program using the Scanner Class?
I have to write a program that asks for the speed of a vehicle (in miles-per-hour) and the number of hours it has traveled. It should use a loop to display the distance a vehicle has traveled for each hour of a time period specified by the user. Such as 1 hour will equal 40 miles traveled, 2 hours will equal 80, 3 hours will equal 120, etc. This is what I've come up with thus far. Any help is appreciated.
import java.util.Scanner;
public class DistanceTraveled
public static void main(String[] args)
int speed;
int hours;
int distance;
Scanner keyboard = new Scanner(System.in);
System.out.print("What is the speed of the vehicle in miles-per-hour?");
speed = keyboard.nextInt();
System.out.print("How many hours has the vehicle traveled for?");
hours = keyboard.nextInt();
distance = speed*hours;
while (speed < 0)
while (hours < 1)
System.out.println("Hour Distance Traveled");
System.out.println("------------------------");
System.out.println(hours + " " + distance);
}When you post code, wrap it in code tags. Highlight it and click the CODE button above the text input area.
You seem to be trying to reuse the speed and hours variables in your loop. That's probably a mistake at this point. Keep it simpler by defining a loop variable.
Also I don't see the need for two loops. You just want to show how far the vehicle has traveled for each one-hour increment, assuming constant speed, for the number of hours it has been traveling, right? So a single for loop should be sufficient. -
HELP Needed with this error: Exception in thread "main" java.lang.NoClass
Folks,
I am having a problem connecting to my MSDE SQL 2000 DB on a WindowsXP pro. environment. I am learning Java and writing a small test prgm to connect the the database. The code compiles ok, but when I try to execute it i keep getting this error:
"Exception in thread "main" java.lang.NoClassDefFoundError: Test1"
I am using the Microsoft jdbc driver and my CLASSPATH is setup correctly, I've also noticed that several people have complained about this error, but have not seen any solutions....can someone help ?
Here is the one of the test programs that I am using:
import java.sql.*;
* Microsoft SQL Server JDBC test program
public class Test1 {
public Test1() throws Exception {
// Get connection
DriverManager.registerDriver(new
com.microsoft.jdbc.sqlserver.SQLServerDriver());
Connection connection = DriverManager.getConnection(
"jdbc:microsoft:sqlserver://LAPTOP01:1433","sa","sqladmin");
if (connection != null) {
System.out.println();
System.out.println("Successfully connected");
System.out.println();
// Meta data
DatabaseMetaData meta = connection.getMetaData();
System.out.println("\nDriver Information");
System.out.println("Driver Name: "
+ meta.getDriverName());
System.out.println("Driver Version: "
+ meta.getDriverVersion());
System.out.println("\nDatabase Information ");
System.out.println("Database Name: "
+ meta.getDatabaseProductName());
System.out.println("Database Version: "+
meta.getDatabaseProductVersion());
} // Test
public static void main (String args[]) throws Exception {
Test1 test = new Test1();I want to say that there was nothing wrong
with my classpath config., I am still not sure why
that didn't work, there is what I did to resolved
this issue.You can say that all you like but if you are getting NoClassDefFound errors, that's because the class associated with the error is not in your classpath.
(For future reference: you will find it easier to solve problems if you assume that the problem is your fault, instead of trying to blame something else. It almost always is your fault -- at least that's been my experience.)
1. I had to set my DB connection protocol to TCP/IP
(this was not the default), this was done by running
the
file "svrnetcn.exe" and then in the SQL Server Network
Utility window, enable TCP/IP and set the port to
1433.Irrelevant to the classpath problem.
2. I then copied all three of the Microsoft JDBC
driver files to the ..\jre\lib\ext dir of my jdk
installed dir.The classpath always includes all jar files in this directory. That's why doing that fixed your problem. My bet is that you didn't have the jar file containing the driver in your classpath before, you just had the directory containing that jar file.
3. Updated my OS path to located these files
and....BINGO! (that simple)Unnecessary for solving classpath problems.
4. Took a crash course on JDBC & basic Java and now I
have created my database, all tables, scripts,
stored procedures and can read/write and do all kinds
of neat stuff.All's well that ends well. After a few months you'll wonder what all the fuss was about. -
Can anyone help me with this program?
I have to make program that asks the user for information that they would want on a business card. Then, I am supposed ot take that information that was gathered with a listener and display it on a second panel using graphicsstuff (such as g.drawString(VARIABLEHERE, int x, int y). I can get thepart of the program that would ask for the information, but I can't figure out where to go from there on how to display the information. If anyone could help I would be enternally gratefully. This assignment is due Friday morning at 9:00. Thanks!
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class PanelPractice extends JPanel
private static JButton insert;
private static JTextField nameField, positionField, areaField, telField, faxField, emailField, add1Field, add2Field, add3Field;
private static String nameText, positionText, areaText, telText, faxText, emailText, add1Text, add2Text, add3Text;
public static void main (String[] args)
//Makes two colored panels that are nested within a third.
JFrame frame = new JFrame ("Business Card");
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
//Makes the first subpanel
JPanel subPanel1 = new JPanel();
JLabel nameLabel, positionLabel, areaLabel, telLabel, faxLabel, emailLabel, add1Label, add2Label, add3Label;
// Sets up the GUI
//Creates labels for the information questions
nameLabel = new JLabel ("Type the name you want on the card: ");
positionLabel = new JLabel ("Type the person's position: ");
areaLabel = new JLabel ("Type the person's area of business: ");
telLabel = new JLabel ("Type the person's telephone number: ");
faxLabel = new JLabel ("Type the person's fax number: ");
emailLabel = new JLabel ("Type the person's e-mail address: ");
add1Label = new JLabel ("Type the person's place of business: ");
add2Label = new JLabel ("Type the business' street address: ");
add3Label = new JLabel ("Type the business' city, state, and zip: ");
//Creates a JTextField to hold the person's name
nameField = new JTextField (10);
positionField = new JTextField (10);
areaField = new JTextField (10);
telField = new JTextField (10);
faxField = new JTextField (10);
emailField = new JTextField (10);
add1Field = new JTextField (10);
add2Field = new JTextField (10);
add3Field = new JTextField (10);
//add the nameLabel and nameField to the panel
subPanel1.add (nameLabel);
subPanel1.add (nameField);
//add the positionLabel and positionField to the panel
subPanel1.add (positionLabel);
subPanel1.add (positionField);
//add the areaLabel and areaField to the panel
subPanel1.add (areaLabel);
subPanel1.add (areaField);
//add the telLabel and telField to the panel
subPanel1.add (telLabel);
subPanel1.add (telField);
//add the faxLabel and faxField to the panel
subPanel1.add (faxLabel);
subPanel1.add (faxField);
//add the emailLabel and emailField to the panel
subPanel1.add (emailLabel);
subPanel1.add (emailField);
//add the add1Label and add1Field to the panel
subPanel1.add (add1Label);
subPanel1.add (add1Field);
//add the add2Label and add2Field to the panel
subPanel1.add (add2Label);
subPanel1.add (add2Field);
//add the add3Label and add3Field to the panel
subPanel1.add (add3Label);
subPanel1.add (add3Field);
//Creates a button to press to insert the information onto the card
insert = new JButton ("Insert Information!");
//Creates a Listener and makes it listen for the button to be pressed
insert.addActionListener (new ButtonListener());
//add the button to the panel
subPanel1.add (insert);
//set the size of the panel to the width and height constants
subPanel1.setPreferredSize (new Dimension (350, 300));
//set the color of the panel to whatever you choose
subPanel1.setBackground (Color.red);
//Makes the second subpanel
JPanel subPanel2 = new JPanel();
subPanel2.setPreferredSize (new Dimension(500,300));
subPanel2.setBackground (Color.blue);
//Makes the primary panel
JPanel primary = new JPanel();
primary.setBackground (Color.black);
primary.add (subPanel1);
primary.add (subPanel2);
frame.getContentPane().add(primary);
frame.pack();
frame.setVisible(true);
// Represents an action listener for the insert button.
private static class ButtonListener implements ActionListener
public void actionPerformed (ActionEvent event)
//get the text from the textfields
nameText = nameField.getText();
positionText = positionField.getText();
areaText = areaField.getText();
telText = telField.getText();
faxText = faxField.getText();
emailText = emailField.getText();
add1Text = add1Field.getText();
add2Text = add2Field.getText();
add3Text = add3Field.getText();
public static class CustomComponent extends JPanel
public void paintComponent(Graphics g)
super.paintComponent(g);
g.drawString(nameText, 5, 5);
}Sorry about that...
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class PanelPractice extends JPanel
private static JButton insert;
private static JTextField nameField, positionField, areaField, telField, faxField, emailField, add1Field, add2Field, add3Field;
private static String nameText, positionText, areaText, telText, faxText, emailText, add1Text, add2Text, add3Text;
public static void main (String[] args)
//Makes two colored panels that are nested within a third.
JFrame frame = new JFrame ("Business Card");
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
//Makes the first subpanel
JPanel subPanel1 = new JPanel();
JLabel nameLabel, positionLabel, areaLabel, telLabel, faxLabel, emailLabel, add1Label, add2Label, add3Label;
// Sets up the GUI
//Creates labels for the information questions
nameLabel = new JLabel ("Type the name you want on the card: ");
positionLabel = new JLabel ("Type the person's position: ");
areaLabel = new JLabel ("Type the person's area of business: ");
telLabel = new JLabel ("Type the person's telephone number: ");
faxLabel = new JLabel ("Type the person's fax number: ");
emailLabel = new JLabel ("Type the person's e-mail address: ");
add1Label = new JLabel ("Type the person's place of business: ");
add2Label = new JLabel ("Type the business' street address: ");
add3Label = new JLabel ("Type the business' city, state, and zip: ");
//Creates a JTextField to hold the person's name
nameField = new JTextField (10);
positionField = new JTextField (10);
areaField = new JTextField (10);
telField = new JTextField (10);
faxField = new JTextField (10);
emailField = new JTextField (10);
add1Field = new JTextField (10);
add2Field = new JTextField (10);
add3Field = new JTextField (10);
//add the nameLabel and nameField to the panel
subPanel1.add (nameLabel);
subPanel1.add (nameField);
//add the positionLabel and positionField to the panel
subPanel1.add (positionLabel);
subPanel1.add (positionField);
//add the areaLabel and areaField to the panel
subPanel1.add (areaLabel);
subPanel1.add (areaField);
//add the telLabel and telField to the panel
subPanel1.add (telLabel);
subPanel1.add (telField);
//add the faxLabel and faxField to the panel
subPanel1.add (faxLabel);
subPanel1.add (faxField);
//add the emailLabel and emailField to the panel
subPanel1.add (emailLabel);
subPanel1.add (emailField);
//add the add1Label and add1Field to the panel
subPanel1.add (add1Label);
subPanel1.add (add1Field);
//add the add2Label and add2Field to the panel
subPanel1.add (add2Label);
subPanel1.add (add2Field);
//add the add3Label and add3Field to the panel
subPanel1.add (add3Label);
subPanel1.add (add3Field);
//Creates a button to press to insert the information onto the card
insert = new JButton ("Insert Information!");
//Creates a Listener and makes it listen for the button to be pressed
insert.addActionListener (new ButtonListener());
//add the button to the panel
subPanel1.add (insert);
//set the size of the panel to the width and height constants
subPanel1.setPreferredSize (new Dimension (350, 300));
//set the color of the panel to whatever you choose
subPanel1.setBackground (Color.red);
//Makes the second subpanel
JPanel subPanel2 = new JPanel();
subPanel2.setPreferredSize (new Dimension(500,300));
subPanel2.setBackground (Color.blue);
//Makes the primary panel
JPanel primary = new JPanel();
primary.setBackground (Color.black);
primary.add (subPanel1);
primary.add (subPanel2);
frame.getContentPane().add(primary);
frame.pack();
frame.setVisible(true);
// Represents an action listener for the insert button.
private static class ButtonListener implements ActionListener
public void actionPerformed (ActionEvent event)
//get the text from the textfields
nameText = nameField.getText();
positionText = positionField.getText();
areaText = areaField.getText();
telText = telField.getText();
faxText = faxField.getText();
emailText = emailField.getText();
add1Text = add1Field.getText();
add2Text = add2Field.getText();
add3Text = add3Field.getText();
public static class CustomComponent extends JPanel
public void paintComponent(Graphics g)
super.paintComponent(g);
g.drawString(nameText, 5, 5);
} No..I'm not expecting someone to do it for me. I am having trouble figuring out what to do next. I cannot get anything to show up on the second panel...the part that displays the information that the listener gathered.
If I could figure out how to get one thing to show up...then I could probably do the rest...it's getting it started that I can't get. -
Help needed in this program!
Hi, i have written a program for solving a power flow question,using Gaussian elimination method to solve for matrices.The program is pretty long,and i have tried breaking the program into smaller modules,but there were errors in the numeric results at the end.
I need some suggests as to how to break the program into smaller modules???
/* Example 10.6 Pg 347 from Bergen.
Demonstration of Newton-Raphson Iteration.
import java.util.*;
import java.io.*;
import java.lang.Math;
import java.lang.ArrayIndexOutOfBoundsException;
public class NewtonRaphsonIt
public static void main( String args[])throws ArrayIndexOutOfBoundsException
int Deg = 360;
int Loop = 3;
double pi = 3.141592653589793238;
double limit = Math.abs(5E-6);
int i,j,k,u;
double V1,V2,V3,P2,P3,Q3,deltaP2,deltaP3,deltaQ3;
double Theta1,Theta2,Theta3;
double P1,Q1,Q2;
double P_Loss,Q_Loss,PF;
double maxi,temp,temp2;
int tempi=0;
//values given
P2=0.6661; P3=-2.8653; Q3=-1.2244;
V1=1; V2=1.05; Theta1=0;
//values supposely to be chosen as a rough guess
Theta2=Theta3=0; V3=1;
double [][] Y_bus = {{-19.98,10,10},{10,-19.98,10},{10,10,-19.98}};
double [][] J = new double [3][3];
double [] fx = new double [3];
double [] oldx = {Theta2,Theta3,V3};
double [] x = {Theta2,Theta3,V3};
double [] V = {V1,V2,Theta1};
double [] Bus = {P2,P3,Q3};
double [] delta = new double [3];
double [] ANS = new double [3];
int f = fx.length;
int y = Y_bus.length;
int z = J.length;
int c = Bus.length;
int h = delta.length;
int e = ANS.length;
int ox= oldx.length;
//System.out.println("Arrary size for Ybus is:" +n);
//output Ybus Matrix
System.out.println(" Ybus is:");
System.out.println("---------");
for ( i=0; i<y; i++)
for ( j=0; j<y; j++)
System.out.print(+Y_bus[i][j]+" "+", ");
System.out.println();
for ( u=1; u<Loop+1; u++){
//while(delta[0] < limit){
//Jacobian matrix
//deltaP2/deltaTheta2
J[0][0] = (Math.abs(V[1]))* (Math.abs(V[0])) * Y_bus[1][0] * (Math.cos(x[0]))
+ (Math.abs(V[1]))* (Math.abs(x[2])) * Y_bus[1][2] * (Math.cos(x[0]-x[1]));
//deltaP2/deltaTheta3
J[0][1] = -(Math.abs(V[1]))* (Math.abs(x[2])) * Y_bus[1][2] * (Math.cos(x[0]-x[1]));
//deltaP2/delta|V3|
J[0][2] = (Math.abs(V[1])) * Y_bus[1][2] * (Math.sin(x[0]-x[1]));
//deltaP3/deltaTheta2
J[1][0] = -(Math.abs(V[1]))*(Math.abs(x[2])) * Y_bus[2][0] * (Math.cos(x[1]-x[0]));
//deltaP3/deltaTheta3
J[1][1] = (Math.abs(V[0])) *(Math.abs(x[2])) * Y_bus[2][0] * (Math.cos(x[1]))
+(Math.abs(V[1])) *(Math.abs(x[2])) * Y_bus[2][1] * (Math.cos(x[1]-x[0]));
//deltaP3/delta|V3|
J[1][2] = (Math.abs(V[0])) * Y_bus[2][0] * (Math.sin(x[1]))
+(Math.abs(V[1]))* Y_bus[2][1] * (Math.sin(x[1]-x[0]));
//deltaQ3/deltaTheta2
J[2][0] = - Y_bus[2][0] * (Math.abs(x[2])) * (Math.abs(V[1])) *(Math.sin(x[1]-x[0]));
//deltaQ3/deltaTheta3
J[2][1] = (Math.abs(x[2]))*(Math.abs(V[0])) * Y_bus[2][0] * (Math.sin(x[1]))
+(Math.abs(x[2]))*(Math.abs(V[1])) * Y_bus[2][1] * (Math.sin(x[1]-x[0]));
//deltaQ3/delta|V3|
J[2][2] = -((Math.abs(V[0])) * Y_bus[2][0] * (Math.cos(x[1]))
+ (Math.abs(V[1])) * Y_bus[2][1] * (Math.cos(x[1]-x[0]))
+ (Math.abs(x[2]))* 2 * Y_bus[2][2]);
//output Jacobian Matrix
System.out.println();
System.out.println(+u+")"+" Jacobian Matrix is:");
System.out.println("-----------------------");
for ( i=0; i<z; i++)
for ( j=0; j<z; j++)
System.out.print(+J[i][j]+" "+", ");
System.out.println();
// variable P2
fx[0] = (Math.abs(V[1]))*(Math.abs(V[0])) * Y_bus[1][0] * (Math.sin(x[0]-V[2]))
+ (Math.abs(V[1]))*(Math.abs(x[2])) * Y_bus[1][2] * (Math.sin(x[0]-x[1]));
//System.out.println("P2 is :"+fx[0]);
// variable P3
fx[1] = (Math.abs(x[2]))*(Math.abs(V[0])) * Y_bus[2][0] * (Math.sin(x[1]-V[2]))
+ (Math.abs(x[2]))*(Math.abs(V[1])) * Y_bus[2][1] * (Math.sin(x[1]-x[0]));
//System.out.println("P3 is :"+fx[1]);
// variable Q3
fx[2] = -((Math.abs(x[2]))*(Math.abs(V[0])) * Y_bus[2][0] * (Math.cos(x[1]-V[2]))
+ (Math.abs(x[2]))*(Math.abs(V[1])) * Y_bus[2][1] * (Math.cos(x[1]-x[0]))
+ (Math.abs(x[2]))*(Math.abs(x[2])) * Y_bus[2][2]);
//System.out.println("Q3 is :"+fx[2]);
//Output f(x)
System.out.println();
System.out.println(+u+")"+" Function f(x) is:");
System.out.println("--------------------");
for ( k=0; k<f; k++)
System.out.println(+fx[k]);
System.out.println();
//ouput P2,P3,Q3 as a matrix
System.out.println();
System.out.println(+u+")"+" Matrix [P2,P3,Q3] is:");
System.out.println("------------------------");
for ( k=0; k<c; k++)
System.out.println(+Bus[k]);
System.out.println();
//finding values of deltaP2,deltaP3,deltaQ3
System.out.println();
System.out.println(+u+")"+" Matrix [d.P2,d.P3,d.Q3] is:");
System.out.println("------------------------------");
for ( k=0; k<h; k++)
System.out.println(delta[k]= Bus[k]- fx[k]);
System.out.println();
//find delta x={deltaTheta2,deltaTheta3,delta|V3|}
//Gaussian Elimination method
//solve Ax=b
//matrix J will be destroyed,solution will be in matrix delta
if(J[0].length != z)
System.out.println("Matrix J must be a Square Matrix!");
return;
for(j=0; j<z; j++)
maxi=-1E-12;
for(i=j; i<z; i++)
if(Math.abs(J[i][j])> maxi)
tempi=i;
maxi=Math.abs(J[i][j]);
//System.out.println(+tempi);
if(maxi<1E-12)
System.out.println
("The Set either has mutltiple solutions or no unique solution!");
return;
//Permuting tempi row with the j-th row
if(tempi != j)
for(k=j; k<z; k++)
temp=J[j][k]; //store 1st row into temp space
J[j][k]=J[tempi][k]; //store last row into 1st row
J[tempi][k]=temp; //store 1st row back into last row
temp=delta[j]; //store 1st row into temp space
delta[j]=delta[tempi]; //store last row into 1st row
delta[tempi]=temp; //store 1st row back into last row
//System.out.println("deltatemp:"+delta[j]);
//Divide j-th row by J[j][j]
temp=J[j][j];
delta[j]=delta[j]/temp;
System.out.println("delta1:"+delta[j]);
for(k=j; k<z; k++)
J[j][k]=J[j][k]/temp;
for(i=0; i<z; i++)
if(i != j)
temp=J[i][j];
temp2=delta;
for(k=0; k<z; k++)
J[i][k] = J[i][k]-temp*J[j][k];
delta[i]= temp2-temp*delta[j];
System.out.println("delta:"+delta[j]);
System.out.println("J:"+J[i][k]);
// values of deltax in radians
System.out.println(+u+")"+" The solution for AX=b is:");
System.out.println("----------------------------");
for(i=0; i<z; i++)
System.out.println(+delta[i]);
x[i] = delta[i];
// values of deltax in degrees
System.out.println();
System.out.println(+u+")"+" The solution for deltaX is:");
System.out.println("------------------------------");
ANS[0] = x[0] * Deg/(2*pi);
ANS[1] = x[1] * Deg/(2*pi);
ANS[2] = x[2];
for(i=0; i<e; i++)
System.out.println(+ANS[i]);
//finding X^1=x^0 + deltax^0
System.out.println();
System.out.println(" The solution for X after iteration:"+"("+u+")");
System.out.println("---------------------------------------");
for(i=0; i<e; i++)
x[i] = oldx[i] + ANS[i];
System.out.println(+x[i]);
System.out.println();
//System.out.println("oldx:" +oldx[i]);
//System.out.println();
//update the oldx with the new values from x
for(i=0; i<ox; i++)
oldx[i] = x[i];
//System.out.println("oldx:" +oldx[i]);
//System.out.println();
//convert to radians for Math.sin/cos()
x[0] = x[0] * (2*pi)/Deg;
x[1] = x[1] * (2*pi)/Deg;
x[2] = x[2];
}//for loop
//if (delta[0] == limit)
// break;
//}//while loop
// calcuate P1,Q1,Q2
P1 = (Math.abs(V[0]))*(Math.abs(V[1])) * Y_bus[0][1]* (Math.sin(V[2]-x[0]))
+ (Math.abs(V[0]))*(Math.abs(x[2])) * Y_bus[0][2] * (Math.sin(V[2]-x[1]));
System.out.println("P1 is :"+P1);
System.out.println();
Q1 = -((Math.abs(V[0]))*(Math.abs(V[1])) * Y_bus[0][1] * (Math.cos(V[2]-x[0]))
+ (Math.abs(V[0]))*(Math.abs(x[2])) * Y_bus[0][2] * (Math.cos(V[2]-x[1]))
+ (Math.abs(V[0]))*(Math.abs(V[0])) * Y_bus[0][0]);
System.out.println("Q1 is :"+Q1);
System.out.println();
Q2 = -((Math.abs(V[1]))*(Math.abs(V[0])) * Y_bus[1][0] * (Math.cos(x[0]-V[2]))
+ (Math.abs(V[1]))*(Math.abs(x[2])) * Y_bus[1][2] * (Math.cos(x[0]-x[1]))
+ (Math.abs(V[1]))*(Math.abs(V[1])) * Y_bus[1][1]);
System.out.println("Q2 is :"+Q2);
System.out.println();
//Power Loss P_Loss = (P1+P2) - P3
P_Loss = (P1+P2) - P3;
System.out.println("Power Loss is :"+P_Loss);
System.out.println();
System.out.println("P2 is :"+P2);
System.out.println();
System.out.println("P3 is :"+P3);
System.out.println();
System.out.println("Q3 is :"+Q3);
System.out.println();
//Reactive Power Loss
Q_Loss = (Q1+Q2) - Q3;
System.out.println("Reactive Power Loss:" +Q_Loss);
System.out.println();
System.out.println("Q1 is :"+Q1);
System.out.println();
System.out.println("Q2 is :"+Q2);
System.out.println();
System.out.println("Q3 is :"+Q3);
System.out.println();
//Power factor PF = P/sqrt[(P^2 + Q^2)]
PF = P3/(Math.sqrt( (P3*P3) + (Q3*Q3)));
System.out.println("Power Factor is :"+PF);
System.out.println();Start off by creating a Matrix class, rather than doing it all with 2d arrays in the main method? (The Matrix class might do little more than be a wrapper around a 2d array, but at least it would be a bit more modular.)
-
Hi all,
I am trying to executr this .it is compiled and running but it ids giving no out put.(def.doc not found)
import org.apache.poi.hdf.extractor.util.*;
import org.apache.poi.hdf.extractor.data.*;
import org.apache.poi.hdf.extractor.*;
import java.util.*;
import java.io.*;
import javax.swing.*;
import java.awt.*;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.poifs.filesystem.POIFSDocument;
import org.apache.poi.poifs.filesystem.DocumentEntry;
import org.apache.poi.util.LittleEndian;
class hdf {
String origFileName;
String tempFile;
WordDocument wd;
hdf(String origFileName, String tempFile) {
this.tempFile=tempFile;
this.origFileName=origFileName;
public void getText() {
try {
wd = new WordDocument(origFileName);
Writer out = new BufferedWriter(new FileWriter(tempFile));
wd.writeAllText(out);
out.flush();
out.close();
catch (Exception eN) {
System.out.println("Error reading document:"+origFileName+"\n"+eN.toString());
public static void main(String args[])
hdf h=new hdf("c:\\abc.doc","c:\\def.doc");
}// end
thanks in advanceThe solution is for you to either learn something about Java, or just drop it.
If you decide on the first course...
Sun's basic Java tutorial
Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
Bruce Eckel's Thinking in Java (Available online.)
Joshua Bloch's Effective Java
Bert Bates and Kathy Sierra's Head First Java.
James Gosling's The Java Programming Language. Gosling is
the creator of Java. It doesn't get much more authoratative than this. -
Help need with this expression
I am trying to calculate the ratio... so basically doing the adding two textboxes different textboxes and then diving them with the the sum of two different textboxes... but i am getting an #error..
=(iif(reportItems!Textbox76.Value = nothing,"0.00",reportItems!Textbox76.Value) + iif(reportitems!Textbox94.Value = nothing,"0.00",reportitems!Textbox94.Value)) / iif(((IIF(reportitems!Textbox69.Value = nothing,"0.00",reportitems!Textbox69.Value) + iif(reportitems!Textbox85.Value = nothing,"0.00",reportitems!Textbox85.Value))) = "0.00",1,((IIF(reportitems!Textbox69.Value = nothing,"0.00",reportitems!Textbox69.Value) + iif(reportitems!Textbox85.Value = nothing,"0.00",reportitems!Textbox85.Value))))
Thanks
KarenHi Karen,
I have tested the expression below, it turn out that if one of textboxes's value contain the character except number, then the result of this expression is #Error.
In your scenario, please ensure that there is no any #Error for the below expression:
=Cint(ReportItems!TextBox76.Value)
=Cint(ReportItems!TextBox94.Value)
=Cint(ReportItems!TextBox69.Value)
=Cint(ReportItems!TextBox85.Value)
If you have any questions, please feel free to ask.
Regards,
Charlie Liao
TechNet Community Support -
Help needed with this assignment
Heres the question i have to complete.
Build a new class LotsOfBooks which has an attribute which is an array of Book objects and initialises this array using a constructor method parameter. Write a method "setAllReserved" in LotsOfBooks which invokes setReserved( ) on all the books in the array.
I have to submit my code into a Java compiler that tests my code against the teachers, if it is wrong you get given an error message. My code compiles fine in the compiler Blue J, but in the online tester i get this message.
mismatch in setAllReserved
Sometimes if i jig things about i get a null pointer error in the tester. I do not nesserseraly want a written java answer, just to know what i am doing wrong and what i can change.
NB The array does not have to have any values and the Book class was already given.
public class LotsOfBooks
private Book[] books;
public LotsOfBooks(Object Book[])
public void setAllReserved()
for (int i=0; i<books.length; i++){
Book b =books;
b.setReserved();
public class Book
String author;
String title;
boolean reserved;
boolean onLoan;
public Book(String author, String title){
this.author = author;
this.title = title;
reserved = false;
onLoan = false;
public void setReserved(){
reserved = true;
public void setOnLoan(){
onLoan = true;
public boolean isOnLoan(){
return onLoan;
public String getAuthor(){
return author;well for the preferred on i get
DataSet 1
----------Compilation output--------------------------------------
javac BookTester1.java
BookTester1.java:18: cannot resolve symbol
symbol : constructor LotsOfBooks (Book[])
location: class LotsOfBooks
LotsOfBooks lob = new LotsOfBooks(books);
^
1 error
----------Sorry expected answer was-------------------------------
The method setAllReserved worked OK - well done
----------Your answer however was---------------------------------
++ ERROR ++
Your program did not compile
Scroll back in this window to find more details
[S] Sorry exercise ci101/Wk12BookA was not completed successfully
and for if not i get
DataSet 1
----------Compilation output--------------------------------------
javac BookTester1.java
----------Sorry expected answer was-------------------------------
The method setAllReserved worked OK - well done
----------Your answer however was---------------------------------
Exception in thread "main" java.lang.ClassCastException
at LotsOfBooks.<init>(LotsOfBooks.java:6)
at BookTester1.main(BookTester1.java:18)
[S] Sorry exercise ci101/Wk12BookA was not completed successfully -
Help Needed with this stupid Nano
I have got a Nice shiny green 16Gb 4th Gen Ipod Nano and I have got all 130+ albums with covers on etc but i cant get my videos to come on via itunes.
I have even downloaded the sample video from apple which is .mov and clicked add to library and it show under movies but when i goto connect the cable it says its syncing and then ejects but no videos on there.
Please helpIn Step 5 of "Changing the Column Components" you change the Trip Type column to a drop-down list.
5. Select TRIP.TRIPTYPEID from the Selected list and make the following changes:
* Change the Header text field from TRIPTYPEID to Trip Type.
* Using the drop-down list, change the Component Type from Static Text to Drop Down List.
6. Click OK to enforce your changes and dismiss the window. If the table columns are too wide after performing the above steps, you can resize them by selecting the first component in each column and dragging its selection handles.
7. In the Visual Designer, select the top Drop Down List component in the Table. Right-click and choose Bind to Data from the pop-up menu. The Bind to Data dialog box opens.
Maybe you are looking for
-
How to print history report without refreshing?
Hi, Does someone tell me how to print history report (deski, webi, and crystal) without refreshing via Java API? I could not find in Java doc and Developer Library. thanks, Tak
-
No consigo que funcione Airplay en mi imac, no es compatible con este ordenador? es de diciembre de 2011
-
We have confg. our WebSphere server to use SSL. When trying to connect to EAS, using the SERVER:PORT where the port is the SSL port, we cannot connect. If we use the standard port, it works. Anyone able to use EAS with WebSphere using SSL? Note, we d
-
How can I get msproject data into powerpivot? Do I need project installed, or is there a way to retrieve the data without instaling it (as you can do with access) Thanks
-
Intermittent home button failure on i4
During the past couple weeks, I sometimes have to press the home button several times for it to work... this happens when the phone is asleep and when it is awake, when apps are running and when no app is running. And sometimes, the home button works