Page 1 of 1

Howto : program for charge and discharge an capacitor across an resistor with an voltage source?

Posted: Wed Mar 16, 2016 8:36 am
by Stephane38
would like to program the x-y coordinate system.
Is there really is not to implement a general formula for the calculation of the window,
and this in a general function ?.
The intention is to have on this x -y axis the curve drawing which is generated with the
function eg the uc (t) and i (t) for charging a capacitor via a resistor or
another application.
I don't find any general formula for calculation the window.
It is not supposed to have to rewrite all my code but some parts where I stuck .
The problem is always that I never see a curve.

My question are:

1) Can here someone once in a general formula a function items for the calculation of the window range?

2) How do I draw the lines with the values ​​of the x and y axis ?.
As x axis is time axis , and this is then divided into lines , and there are then placed on the values ​​for the same y - axis
Refer to the figure of the x-y axis on the zero line

How can I charge and discharge current and capacitor voltage to graphically
visible as and curve. How should I calculate for that is always crashes .
Like a general formula to calculate the points .
Like using ddt statements. The user enters the parameters calculated
in the program and draws and i(t) and uc(t).
image_7490.jpg
image_7490.jpg (11.23 KiB) Viewed 7535 times

Re: Howto : program for charge and discharge an capacitor across an resistor with an voltage source?

Posted: Thu Mar 17, 2016 8:41 pm
by burger2227
You cannot draw LINE's in SCREEN 0, the default. Try SCREEN 12 or 13.

12 is values of x from 0 to 640 (columns from left to right) and 0 to 480 values of y (rows from top down)

To plot a graph, take values of x and y and use LINE(x1, y1)-(x2, y2), 12 '12 is color red

You could put the values into an array and use a loop to read it later.