0% found this document useful (0 votes)
15 views14 pages

Tools

Uploaded by

pietra.santana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views14 pages

Tools

Uploaded by

pietra.santana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

The "Tools" menu

The “Tools” menu makes the resources to solve the following types of problems
available:

1) System of linear equations solution;

2) Integral, derivative and ordinary differential equations (ODE) calculation;

3) Roots of function and non-linear equation;

4) 2D graphs plotting;

5) 3D graphs plotting;

6) Calculator.

System of Equations (S. Eq)


To solve a simple system of equations, at the “Tools” menu, click on “System of
Equations” or on the “S. Eq” button. Then, a dialog box will appear where it is possible to write a
system of equations with up to 6 equations and 6 unknowns.
After informing the coefficients of the system of equations, click on “OK” that the results
will be shown at a dialog box:

If there is need to access the informed data set, click on the “Back” button.

Integral, derivative and ODE (IDDE)


Integral and derivative

To determine the numerical value of the defined integral of a function and also its first
and second derivatives for a value of X, the user must, at the “Tools” menu, click on “Integral,
derivative and ODE” or also on the “IDDE” button. Then, the following dialog box will appear:
Choosing the "Integral and derivative" option and clicking on the “OK” button the
following dialog box will appear:

At the first edit box the function that is under study must be written, in Fortran. At the
second and third boxes the integration limits must be written and, at the last one, the value of
X of the derivatives that will be determined. After, click on “OK”.

Ordinary Differential Equation (ODE)


To determine the numerical solution of an ordinary differential equation up to the fifth
order (or a system, up to five first order equations) you must supply the necessary information
on the dialog box and click on the "OK" button.

Then a new dialog box will appear and you can access the file with the (x,y) points
referring to the numeric solution (Runge-Kutta, fourth order).

Attention: If your ODE is not adequate for the general form shown on the dialog box,
you must transform it into a first order system.
Approximate solution for an ODE
You can try to determine an approximate function, with up to four parameters, for the
numeric solution of an ordinary differential equation (ODE) by using curve fitting. For this
purpose, execute the following steps:

1) Select and copy the points from the file with the numeric solution. If it is
possible, eliminate points with abscissa (or ordinate) smaller or equal to zero;

2) Close the ODE option (“Close” button) ;

3) Click on the "New" button to fit the data;

4) Use the "Paste" option to inform the data;

5) Click on the "Find" button to select the functions;

6) Click on the "Libr" button to fit the selected function;

7) If Xo has a value between Xmin and Xmax you must solve the problem twice,
appending together the following results: a) from Xo up to Xf = Xmin b)
from Xo up to Xf = Xmax.

An Example

y’’ + 0.5y’ = sin(y), with y(0.0)=0.0, y’(0.0)=-1.0, from Xo=0.0 up to Xf=1.0


Clicking on the "IDDE" button and choose the "Second Order" option (from Ordinary
Differential Equation (ODE)) the following dialog box will appear:

so you can supply the necessary information about the ODE. Then, two files are obtained:

1) One with the points of y(x);

2) Another with points of the first derivative y'(x).


See a part of the (x,y(x)) file and of the (x,y’(x)) file:

Accomplishing the seven steps indicated previously for each obtained file, at the end,
the following approximate function is determined with four parameters (in the step 6 you
should set POWER = 50):

y appr = 0.5133e −1.2037 x − 0.5135e 0.7366 x

With the same seven steps an approximate function is determined for the first
derivative:

y' appr = −0.999703 + 0.49339 x − 0.5918 x 2 + 0.12798 x 3


In this example, the results were so good that it is not possible to differentiate the line
that represents the approximate function (and its first derivative) from the points referring to
the numeric solution.

Attention: The Runge-Kutta method does not determine values referring to the second
derivative of the function obtained from a second order ODE but, if you
want it, you could obtain that by direct derivation of the approached function
for the first derivative, y'appr(x):

y' ' appr = 0.49339 − 1.1836 x + 0.38394 x 2

For verification purposes of the obtained results, you could determine y, y' and y'' for
x=0, x=0.5 and x=1.0 (from the approximate functions) which gives the following result:

yappr(0.0)=-0.0002 y’appr(0.0)=-0.9997 y’’appr(0.0)=0.4934


yappr(0.5)=-0.4610 y’appr(0.5)=-0.8850 y’’appr(0.5)=-0.0024
yappr(1.0)=-0.9186 y’appr(1.0)=-0.9701 y’’appr(1.0)=-0.3063

You can observe that, for these results, with small tolerance, the ordinary differential
equation of this example is verified.
Fortran Syntax
Operations:

Addition: +

Subtraction: -

Multiplying: *

Division: /

Power: ** or ^

Functions applied to a value x

Sine of x: sin(x)

Cosine of x: cos(x)

Tangent of x: tan(x)

Arc which the sine is x: asin(x)

Arc which the cosine is x: acos(x)

Arc which the tangent is x: atan(x)

Hyperbolical Sine of x: sinh(x)

Hyperbolical Cosine of x: cosh(x)

Hyperbolical Tangent of x: tanh(x)

Sine of x (x in degrees): sind(x)

Cosine of x (x in degrees): cosd(x)

Tangent of x (x in degrees): tand(x)

Natural Logarithm of x: log(x)

Logarithm of x at the base 10: log10(x)

Exponential of x (e powers x): exp(x)

Root square of x: sqrt(x)

Absolute value of x: abs(x)

Roots of functions (Root)


To determine the roots of a function the user must, at the “Tools” menu, click on the
“Zeroes of functions” option , or at the “Root” option. Then, the following dialog box will appear:
At the first edit box the function must be written. At the two following dialog boxes,
the user must indicate the interval limits in which the roots search will be performed. At the
fourth edit box, the user must write the tolerance (the default value is 1.0E-06) and, at the last
one, the number of subdivisions of the interval, into which ones, the bisection method will be
applied (the default is N = 10 but it was changed to N=50).

In case the user does not have a clear idea if the pointed interval is suitable or not, the
“Graph” button can be clicked and it will be possible to see the function plotted for the given
interval. For the information of the previous dialog box, we have:

It becomes clear, then, that if there are any roots, they must be at the interval between
X = -1,0 and 7,5 (because this is the region where the graph touches or crosses the X axis).
Then, when we close the window with the graph, it will be automatically returned to the dialog
box shown previously, the interval limits must be rewritten with the new values. When “OK” is
clicked, the results will be shown:
2D Graph: User model (G 2D)
To plot the graph of a function with 1 independent variable, the user must, at the “Tools”
menu, click on the “2D Graph: User model” option, or then at the “G 2D” button. Then, the
following dialog box will appear:

The user has, then, the option of informing the function (normal or parametric) or
importing a point set to be linked.

The second case, when “Ok” is clicked, the dialog box for the files’ selection will appear
(browse), and the user must indicate the non-formatted file with the points in columns.

At the first case, when “OK” is clicked for the parametric function, the following dialog
box will appear:
Then you must to inform X(u), Y(u) and the limits for the variable u.

At the first case, when “OK” is clicked for the function normally written, the following
dialog box will appear:

When “Ok” is clicked, the question if it is desired to draw another graph will appear (it
can be possible to plot up to 3 graphs simultaneously). Answering no, a new box for the
definition of how the graph must be plotted will appear:

When “OK” is clicked, the plotted graph will appear:


At the same time that the 2D graph is being plotted, a dialog box appears with the graph
final characterization (title, legend, axis and function definition):

Once the 2D graph is characterized, there are two options to print it.

To use the first option, click on “Print window ”, at the “File” menu, but this option is
used to print only a sketch, because the printing will not have a good quality: the printed picture
will have the same resolution shown on screen.

The second option makes possible to print a graph with a better quality than the
previous one, what can be done by clicking on the “Superzoom in” item at the “Graph” menu.
The graph will be, then, plotted again, but with a much higher resolution than the original one,
using a much bigger space than the available screen size. After that, at the “File” menu, the
user must click on “Print graph (superzoom)”.
To paste the graph, the user must choose, at the “Edit” menu, the “Select All” option as
it is shown at the picture at next:

Then, at the “Edit” menu, it must be clicked on “Copy”, as it is shown at next.

Then, it is just a matter of opening the document, and pasting the image that was stored
at the clipboard.

3D Graph: User model (G 3D)


To plot a graph with 2 independent variables the user must, at the “Tools” menu, click
on the “3D Graph: User model” option, or at the “G 3D” button. Then, the following message will
appear: ‘Please: click on “graph” menu and set the parameters!’. When “Ok” is clicked, at
the message box, and afterwards on the “Graph” item of the menu of the same name, the
following dialog box will appear:

At the first edit box, the function of two variables (X1 and X2) , which the graph will be
drawn must be written. At the following edit boxes, the interval limits of X1 and X2 must also be
written. When “OK” is clicked the graph will be drawn.
At the same time that the 3D graph is being drawn, a new box for the final
characterization appears (title, legend, axis and function definition):

Once the 3D graph is characterized, there are two options to print it.

To use the first option, we must click on “Print window”, at the “File” menu, but this
option is only used to print only a sketch, because the printing is not of good quality: the printed
picture will have the same resolution shown on screen.
The second option makes it possible to print a graph with a better quality than the
previous one, what can be done by clicking on the “Superzoom in” item from the “Graph”
menu. The graph will be, then, drawn again, but with a resolution much higher than the original
one, occupying a much bigger space than the available screen size. After that, at the “File”
menu, the user must click on “Print graph (superzoom)”.

To paste the graph on a document, the user must, at the “Edit” menu, select the “Select
All” option as it is shown at the picture at next:

After, at the same “Edit” menu, we must click on “Copy”, as it is shown at next.

Then, it is only a matter of opening the document, and pasting the image that was
stored at the clipboard.

The “Design” menu of the Graph3D


In case the user is plotting a 3D graph, some unique options can be chosen, that are
shown at the “Design” menu, at next.

The “Rotation (surface: wire)” option makes it possible to rotate the graph in up to 45
degrees (the default is 0 degrees) but does not work for a solid mesh which is the default
option. Whereas the “Color” option makes it possible to choose among six distinct colors
(standard, blue, red, magenta, green and gray, the default is standard) for the drawing of the
wire frame or the solid mesh. The “Grid” option makes it possible to draw grids at the X1-Y,
X2-Y and X1-X2 planes (the default is with grids enabled) whereas, clicking on “Lines”, the user
can indicate with how many lines the surface must be drawn (from 10 up to 100, the default is
40).

You might also like