Sponsored Content
Top Forums Programming can this b numerically SOLVED in FORTRAN? Post 302524211 by Loic Domaigne on Sunday 22nd of May 2011 10:54:38 AM
Old 05-22-2011
You need to discretize your equation in time (i.e. using small dt). You just then compute the y(t) for t=0 until the first t where y(t)<=0 (i.e. the projectile has reached the original elevation).
Code:
// pseudo-code 
ymax  = 0
tymax = 0
t        = 0
yt      = 0
while (yt >=0 ) do
    // compute y(t) at t+dt using RK-4 for instance
    if yt > ymax then 
        ymax  = yt
        tymax = t 
    endif
    t+=dt
end while

Then question a) is given by ymax, b) by tymax and c) by t at the end of the while loop.

Sorry to not help you straight away with the Fortran program, last time I did Fortran stuff was about 15 years ago!

HTH, Loïc
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sort file alphabetically AND numerically

Hi all. I have 2 files like this: f1 A 10 B 80 C 9 f2 A 11 B 700 C 10 What I want is the concatenation of the two files sorted by name (alphabetically) and size (numerically), so the result should be like this: F3 (cat f1 f2 sorted) A 10 A 11 B 80 B 700 (2 Replies)
Discussion started by: mrodrig
2 Replies

2. Shell Programming and Scripting

Numerically sort problem for a long list of file name

I got a long list of file name. My input: data_1.txt data_2.txt data_3.txt data_10.txt data_21.txt data_12.txt data_4.txt My desired output: data_1.txt data_2.txt data_3.txt data_4.txt data_10.txt data_12.txt data_21.txt Does anybody got idea how to archive it? (11 Replies)
Discussion started by: patrick87
11 Replies

3. UNIX for Dummies Questions & Answers

Sort 2 columns numerically

Hi, A basic query. In the example file below, I want to sort by column 1 and then by column 2 numerically. I have tried sort -k2n,1 file1 but while this sorts the columns in the correct order, it does not sort column 2 numerically. Any help would be much appreciated. Also, if you have time to... (3 Replies)
Discussion started by: auburn
3 Replies

4. Shell Programming and Scripting

Sort numerically a non numerical

Hello, I have this sample data: 01 * * * * 01 * * * * 01 * * * * 01 * * * * 01 0 * * * 01 0 * * * 01 0 * * * 01 0 * * * 02 * * * 0 02 * * * 0 02 * * * 6 02 * * * 6 02 0 * * 1 02 0 * * 1 02 0 * * 2 02 0 * * 2 02 0 * * 3 (3 Replies)
Discussion started by: gio001
3 Replies

5. Shell Programming and Scripting

Sort alphabetically, then numerically

Greetings - I'm not necessarily new to bash scripting - I'm probably between beginner and intermediate, but I have something that I just cannot figure out after many attempts to find it. I have a file that is merely a list of many files, with their respective paths, and a branch path (ClearCase)... (5 Replies)
Discussion started by: 1cor29
5 Replies

6. UNIX for Dummies Questions & Answers

numerically sorted filenames

How do you sort filenames: 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 as: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 (6 Replies)
Discussion started by: kenneth.mcbride
6 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Reverse the order of a list of file names (but not sort them alphabetically or numerically)

Hello all, I have a list of file names in a text document where each file name consists of 4 letters and 3 numbers (for example MACR119). There are 48 file names in the document (they are not in alphabetical or numerical order). I would like to reorder the list of names so that the 48th name is... (3 Replies)
Discussion started by: MDeBiasse
3 Replies

8. UNIX for Dummies Questions & Answers

Sorting numerically considering both negative and positve numbers

Dear Experts, I have an IP file which looks like below ---- 100 200 5.02 100 200 -2.99 100 200 -3.01 200 300 2.05 200 300 3.01 200 300 -5.06 I want an OP which looks like (decreasing numerically)-- 100 200 5.02 100 200 -2.99 100 200 -3.01 200 300 3.01 200 300 2.05 200 300 -5.06 (2 Replies)
Discussion started by: Indra2011
2 Replies

9. Shell Programming and Scripting

List numerically in ascending order

Hello, I am running ubuntu 16.04 and trying to list all files inside a directory, I need to sort them in ascending order. While surfing on the site, I found an old thread but somehow it did not work. Link Ascending order with sort -nk2 myfile.txt command gives below output: file... (5 Replies)
Discussion started by: baris35
5 Replies

10. UNIX for Beginners Questions & Answers

How to sort files in directory numerically?

Trying to sort a bunch of files numerically but can't seem to get the command just right. This is in a IBM AIX machine. I have a directory that has... backup.bk1 backup.bk100 backup.bk2 backup.bk200 backup.bk3 backup.bk300 There are a lot more files but this is shortened for the... (5 Replies)
Discussion started by: c3rb3rus
5 Replies
PLIMAGEFR(3plplot)						    PLplot API							PLIMAGEFR(3plplot)

NAME
plimagefr - Plot a 2D matrix using color map1 SYNOPSIS
plimagefr(idata, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, pltr, pltr_data) DESCRIPTION
Plot a 2D matrix using color map1. Redacted form: General: plimagefr(idata, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, pltr, pltr_data) This function is used in example 20. ARGUMENTS
idata (PLFLT**, input) A 2D array of values (intensities) to plot. Should have dimensions idata[nx][ny]. nx, ny (PLINT, input) Dimensions of idata xmin, xmax, ymin, ymax (PLFLT, input) Stretch image data to these Plot coordinates. idata[0][0] corresponds to (xmin, ymin) and idata[nx - 1][ny - 1] corresponds to (xmax, ymax). zmin, zmax (PLFLT, input) Only data between zmin and zmax (inclusive) will be plotted. valuemin, valuemax (PLFLT, input) The minimum and maximum data values to use for value to color mappings. A datum equal to or less than valuemin will be plotted with color 0.0, while a datum equal to or greater than valuemax will be plotted with color 1.0. Data between valuemin and valuemax map linearly to colors between 0.0 and 1.0. pltr (void (*) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer) , input) Pointer to function that defines a transformation between the data in the array idata and world coordinates. An input coordinate of (0, 0) corresponds to the "top-left" corner of idata while (nx, ny) corresponds to the "bottom-right" corner of idata. Some trans- formation functions are provided in the PLplot library: pltr0(3plplot) for identity mapping, and pltr1(3plplot) and pltr2(3plplot) for arbitrary mappings respectively defined by one- and two-dimensional arrays. In addition, user-supplied routines for the trans- formation can be used as well. Examples of all of these approaches are given in the PLplot documentation. The transformation func- tion should have the form given by any of pltr0(3plplot), pltr1(3plplot), or pltr2(3plplot). pltr_data (PLPointer, input) Extra parameter to help pass information to pltr0(3plplot), pltr1(3plplot), pltr2(3plplot), or whatever routine is externally sup- plied. AUTHORS
Geoffrey Furnish and Maurice LeBrun wrote and maintain PLplot. This man page was automatically generated from the DocBook source of the PLplot documentation, maintained by Alan W. Irwin and Rafael Laboissiere. SEE ALSO
PLplot documentation at http://plplot.sourceforge.net/resources. August, 2012 PLIMAGEFR(3plplot)
All times are GMT -4. The time now is 02:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy