Loading ...
Sorry, an error occurred while loading the content.

40528Re: [libertybasic] Re: plot using EXCEL

Expand Messages
  • John Fisher
    Apr 1, 2010
      Or with axes added....


      nomainwin

      ebat = 1e2
      r = 3.0e6
      c = 10e-12

      WindowWidth = 530
      WindowHeight = 560

      graphicbox #w.g, 10, 10, 500, 500

      open "Charging Capacitor" for window as #w

      #w, "trapclose [quit]"

      #w.g, "size 2 ; goto 10 10 ; down ; box 490 490"

      #w.g, "place 190 200 ; font arial 18 bold"
      #w.g, "\Discharging CR circuit"

      #w.g, "size 1 ; color lightgray"

      for vAxis =1 to 5
      #w.g, "line "; 10 +int( vAxis /5 *480); " 10 "; 10 +int( vAxis
      /5 *480); " 490"
      next vAxis

      for hAxis =1 to 10
      #w.g, "line 10 "; 10 +int( hAxis /10 *480); " 490 "; 10 +int(
      hAxis /10 *480)
      next hAxis

      #w.g, "size 2"

      for t =0 to 5 *r *c step r *c /50
      ec =ebat *( 1 -exp( 0 -t / ( r *c)))
      er = ebat -ec
      #w.g, "color red ; set "; 10 +int( t / ( 5 * r *c) *480); " ";
      490 -int( er /ebat *480)
      #w.g, "color blue ; set "; 10 +int( t / ( 5 * r *c) *480); " ";
      490 -int( ec /ebat *480)
      next t

      #w.g, "flush"

      confirm "Send to printer?"; answer
      if answer then #w.g, "print vga"

      wait

      [quit]
      close #w
      end
    • Show all 22 messages in this topic