Plane & Spherical Wave Model (2D)

Plane & Spherical Wave Model (2D) preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.1.1 • Viewed 21 times • Downloaded 2 times • Run 0 times
Download the 'Plane & Spherical Wave Model (2D)' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Info tab cannot be displayed because of an encoding error

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [wave_num c]
patches-own [esfera1 esfera2 esfera3 esfera4 esfera5 esfera6 esfera7 esfera8 esfera9 plano1 plano2 plano3 plano4]

to setup
  clear-all
  reset-ticks
  calculate-init-values
end 

to calculate-init-values
  set c 3
  ask patches[set esfera1 0 set esfera2 0]
end 

to go
wave-generator
  repeat display-velocity [tick]
end 

to wave-generator
  set wave_num (2 * pi / wave_len)
  ask patches[
;===========================================================PLANOS=============================================
ifelse(plano-1)[
      let r wave_num * (- pxcor + pycor)
      set plano1 20 * cos(r * (10 ^ 3) - ticks * wave_num * c * (10 ^ 2) )
    ]
    [set plano1 0]

ifelse(plano-2)[
      let r wave_num * (pxcor + pycor)
      set plano2 20 * cos(r * (10 ^ 3) - ticks * wave_num * c * (10 ^ 2) )
    ]
    [set plano2 0]

ifelse(plano-3)[
      let r wave_num * (- pxcor - pycor)
      set plano2 20 * cos(r * (10 ^ 3) - ticks * wave_num * c * (10 ^ 2) )
    ]
    [set plano3 0]

ifelse(plano-4)[
      let r wave_num * (pxcor - pycor)
      set plano4 20 * cos(r * (10 ^ 3) - ticks * wave_num * c * (10 ^ 2) )
    ]
    [set plano4 0]
;===========================================================ESFERAS=============================================
             ifelse(esfera-1)  [
      let r (sqrt((pxcor + x) ^ 2 + (pycor - y) ^ 2))
      set esfera1   500 * (1 / ( r + 0.000001) ) * cos(wave_num * r * (10 ^ 3) -  ticks * wave_num * c * (10 ^ 2))    ]
      [  set esfera1 0      ]

       ifelse(esfera-2)[
    let r (sqrt((pxcor) ^ 2 + (pycor - y) ^ 2))
    set esfera2   500 * (1 / ( r + 0.000001) ) * cos(wave_num * r * (10 ^ 3) -  ticks * wave_num * c * (10 ^ 2))    ]
  [  set esfera2 0]

  ifelse(esfera-3) [
    let r (sqrt((pxcor - x) ^ 2 + (pycor - y) ^ 2))
    set esfera3   500 * (1 / ( r + 0.000001) ) * cos(wave_num * r * (10 ^ 3) -  ticks * wave_num * c * (10 ^ 2))    ]
  [ set esfera3 0 ]


  ifelse(esfera-4)[
   let r (sqrt((pxcor + x) ^ 2 + (pycor) ^ 2))
   set esfera4   500 * (1 / ( r + 0.000001) ) * cos(wave_num * r * (10 ^ 3) -  ticks * wave_num * c * (10 ^ 2)) ]
  [ set esfera4 0 ]

      ifelse(esfera-5)[
      let r ( sqrt((pxcor ^ 2) + (pycor ^ 2) ))
      set esfera5   500 * (1 / ( r + 0.000001) ) * cos(wave_num * r * (10 ^ 3) -  ticks * wave_num * c * (10 ^ 2))    ]
      [ set esfera5 0]


    ifelse(esfera-6)  [
     let r (sqrt((pxcor - x) ^ 2 + (pycor) ^ 2))
     set esfera6   500 * (1 / ( r + 0.000001) ) * cos(wave_num * r * (10 ^ 3) -  ticks * wave_num * c * (10 ^ 2))    ]
  [  set esfera6 0 ]




  ifelse(esfera-7)[
   let r (sqrt((pxcor + x) ^ 2 + (pycor + y) ^ 2))
   set esfera7   500 * (1 / ( r + 0.000001) ) * cos(wave_num * r * (10 ^ 3) -  ticks * wave_num * c * (10 ^ 2))    ]
  [  set esfera7 0  ]


  ifelse(esfera-8)[
   let r (sqrt((pxcor) ^ 2 + (pycor + y) ^ 2))
   set esfera8   500 * (1 / ( r + 0.000001) ) * cos(wave_num * r * (10 ^ 3) -  ticks * wave_num * c * (10 ^ 2))    ]
  [  set esfera8 0]


ifelse(esfera-9) [
      let r (sqrt((pxcor - x) ^ 2 + (pycor + y) ^ 2))
      set esfera9   500 * (1 / ( r + 0.000001) ) * cos(wave_num * r * (10 ^ 3) -  ticks * wave_num * c * (10 ^ 2))    ]
    [  set esfera9 0]




;===========================================================COLOREAR=============================================

set pcolor  scale-color blue (100 + esfera1 + esfera2 + esfera3 + esfera4 + esfera5 + esfera6 + esfera7 + esfera8 + esfera9 + plano1 + plano2 + plano3 + plano4) 0 244
  ]
end 

There is only one version of this model, created 4 months ago by Sebastián Omar Rodríguez Falcón.

Attached files

File Type Description Last updated
Plane & Spherical Wave Model (2D).png preview Preview for 'Plane & Spherical Wave Model (2D)' 4 months ago, by Sebastián Omar Rodríguez Falcón Download

This model does not have any ancestors.

This model does not have any descendants.