1 / 13

Java for the Electronic Textbook/Classroom on Ocean Wave Theory

Java for the Electronic Textbook/Classroom on Ocean Wave Theory. May 25/2000 Sangsoo Ryu.

orinda
Download Presentation

Java for the Electronic Textbook/Classroom on Ocean Wave Theory

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Java for the Electronic Textbook/Classroom on Ocean Wave Theory May 25/2000 Sangsoo Ryu Ocean Engineering / Texas A&M University

  2. Nonlinear ocean waves: random wave characteristics, wave statistics, significant wave height and period, decomposition into plane progressive waves, wave spectra in 2-D and 3-D.Nonlinear wave theories: Stokes, cnoidal, stream func., solitary wave theoryOff-shore structure/wave interaction: TLPs and semi-submersiblesNon-linear wave effects: “ringing” or “springing,” wave impact and entryWave-wave interactions in ocean wavesNumerical methods TAMU’s Tasks Ocean Engineering / Texas A&M University

  3. Project Overview • Building an interactive web site: CGI scripts, Java scripts/applets, ActiveX, VRML • Running Java Applets a.JDK @ www.javasoft.com b.web browser that supports Java (Netscape 3.01/4.0, IE3.0) • Examples of Java Applets Dr. Kinnas’ website: www.ce.utexas.edu/prof/kinnas/319lab/ Dr. Dalrymple’s website: www.coastal.udel.edu/faculty/rad/ Ocean Engineering / Texas A&M University

  4. What's JAVA? Sun Microsystems James Gosling, Arthur Van Hoff, Andy Bechtolsheim Indonesian Coffee Ocean Engineering / Texas A&M University

  5. Why JAVA is cool? A programming language ( better than Fortran, C++?) You can do: interact with web pages play games, realtime video, and inline sound/animation calculate spreadsheets chat in realtime get continuously updated data … As a language Java is: Simple Object-Oriented Platform Independent Safe High Performance Multi-Threaded Ocean Engineering / Texas A&M University

  6. Basic Java Environment - web browser - Java compiler - Java interpreter - editor - debugger - visual development environment (Visual Café,…) ref. Java class – methods and data Ocean Engineering / Texas A&M University

  7. JDK (v1.2) javac - compiler java - interpreter javaprof - profiler javah - header file generator jdb - java debugger appletviewer Ocean Engineering / Texas A&M University

  8. Basic Syntax • Braces and Blocks – { and }, indentation • Comments - /* … */, or // • Data and Variables • Command Line Arguments (args[0], args[1],…) • If and Else Math Math.PI, Math.pow, Math.sqrt, Math.abs, Hyper.tanh, Math.asin, eig.Eigenmatrix, etc. System System.out.println, System.out.print, etc. Ocean Engineering / Texas A&M University

  9. Procedure to Execute Java Program 1. Make Java source code (filename.java) 2. Execute Java compiler (c:\>javac filename.java) 3. Correct errors if they are found (see the comment below) 4. Get Java bytecode (filename.class) 5. Run Java interpreter (c:\>java filename) 6. Run appletviewer (c:\>appletviewer xxx.html) Types of Error 1. Compile-time error (syntax error) 2. Run-time error (ex. NaN) 3. Logical error Ocean Engineering / Texas A&M University

  10. Example of Java Source Code Example of Html Tag // Description: This applet helps students determine the power needed for a pump import java.awt.*; public class Energy extends Applet implements Runnable rotatedarray[i]=(float)((thearray[i]-midx)*Math.cos(theangle)+(thearray[i+1]- midy)*Math.sin(theangle)+midx); rotatedarray[i+1]=(float)(-(thearray[i]-midx)*Math.sin(theangle)+(thearray[i+1]- midy)*Math.cos(theangle)+midy); public boolean mouseDrag(Event e,int x,int y) Example of HTML Tag <applet archive="Energy.zip" code="Energy.class" width=575 height=400> <IMG SRC="EnergyNoJava.gif" WIDTH="575" HEIGHT="400" ALT="Energy Applet Image (get Java!)"><BR>If you are reading this then your browser is not Java enabled, sorry. </applet> Ocean Engineering / Texas A&M University

  11. Study Plan for JAVA Ocean Engineering / Texas A&M University

  12. Examples Ocean Engineering / Texas A&M University

  13. Coming Soon... 1. Visual toolkit install 2. Java graphics 3. Application to ALP example 4. Homepage development 5. Link with other softwares 6. …. Ocean Engineering / Texas A&M University

More Related