GithubHelp home page GithubHelp logo

tarea-4's Introduction

Buenos días, quiero hacer esto:

import numpy as np

nx = 5 P = np.zeros((nx,1)) U = np.zeros((nx-1,1)) #Velocidad en los nodos de velocidad A = np.zeros((nx,1)) dx = 2.0/(nx-1)

#Calculo de areas A[0,0] = 0.5 A[nx-1,0] = 0.1 def calc_area(A0,An,l): A= 2*((-(A0 - An)/4)*l + (A0/2)) return A

for i in range(1,nx-1): A[i,0]=calc_area(A[0,0],A[nx-1,0],i*dx)

#Adivinar velocidades y presiones: P[0,0] = 10.0 P[nx-1,0] = 0.0 rho = 1.0 vel_caras = np.zeros((nx,1)) #velocidad en los nodos de presion (caras) estimada vel_caras[0,0] = np.sqrt((P[0,0]-P[nx-1,0])2.0/(rho(1-(A[nx-1,0]/A[0,0])**2)))/(A[0,0]/A[nx-1,0]) #Son las velocidades de las caras

for i in range(1,nx): vel_caras[i,0] = vel_caras[i-1,0]A[i-1,0]/(A[i,0]) P[i,0] = P[i-1,0] - 0.5rho*((vel_caras[i,0]**2) - (vel_caras[i-1,0]**2)) print(vel_caras[i,0])

for i in range(0,nx-1): U[i,0] = (vel_caras[i+1,0]+vel_caras[i,0])/2

tarea-4's People

Contributors

joaquinhoffmann avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.