[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave's contour function

From: Fernando Fraga e Silva
Subject: Re: Octave's contour function
Date: Sat, 9 Dec 2000 18:55:07 -0200

On Quinta 07 Dezembro 2000 20:36, Jonathan M Hill wrote:

I'm very thanks for the attention , but I've just learned how to use the 
function ,  and decided reply a sample code using the function showing how to 
use it to plot a potential field .

>      I was just playing with the contour function the other day and
> managed to make a simple example.  I used the online help to
> construct the  example.  I'm sorry that I don't have much experience
> with this.

I`ve solved my problem and make a simple example using contour :
#!/usr/bin/octave -qf
# Plota as linhas de corrente do escoamento ao redor de um cilindro submerso 
em um escoamento uniforme , irrotacional , de ar

Numero_de_elementos = 100;

x = linspace(-10 , 10 , Numero_de_elementos);
y = linspace(-10 , 10 , Numero_de_elementos);
title("Linhas de corrente");
xlabel("coordenada X");
ylabel("coordenada Y");

U = 2.3;        # Velocidade do escoamento ao longe
a = 10;         # Parâmetro geométrico
eps = 1E-5   # valor infinitesimal para evitar divisão por zero

for i = 1:Numero_de_elementos
    for j = 1:Numero_de_elementos
        F(i,j) = y(j)*U - y(j)*U*a^2 / (x(i)^2 + y(j)^2 + eps);

contour( F , 50 , x , y );


Fernando Fraga e Silva - address@hidden
Undergraduated Mechanical Engineering Student from University of São Paulo

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]