I'm new using Processing (RLC circuit using rk4)

I'm new using Processing. I have a task to make a numerical simulation for RLC circuit using rk4. Can someone help me?

Answers

  • Have you run any of the examples provided? If not, open Processing, go to menu File>>Examples and try some of them. The key concept is that you need two functions in processing: setup() and draw(). Setup() always run first and only once. Then draw() follows and run continuously until either you pause it or you quit.

    While you get familiar with the examples, you also need to think what do you want to do with your program. Do you want to draw circuits or do you want create a calculator of some kind.

    By the way, this next link also offers examples of different levels and they are more accessible that the one provided by the Processing IDE:
    https://processing.org/examples/

    Any more questions, provide specific details. Providing code will help in getting better support as it will show your approach.

    When posting code in the forum, before submitting you will need to format your code. To do that, select your code and hit ctrl+o. Ensure there is a line above and below your code. It will look like this:

    void setup(){
      // First line in setup [always]: Width and Height in pixels
      size(800,600);  
    
    }
    
    void draw(){
      //Next line generates a random color. Check the reference
      fill(random(256),random(256),random(256));
      //Place text in your sketch
      text("Welcome to Processing",width/2,height/2);
    }
    

    Reference is a good way to check basic commands. They also provide examples: https://processing.org/reference/

    References for size(), color() and text() as well as setup() and draw():
    https://processing.org/reference/size_.html
    https://processing.org/reference/color_.html
    https://processing.org/reference/text_.html
    https://processing.org/reference/setup_.html
    https://processing.org/reference/draw_.html

    Kf

  • we have no idea what "RLC circuit using rk4" means. care to expand?

  • @koogs Do you realise that we have both given links to the exact same pages?

  • @koogs I want to make a damped oscillation RLC circuit using runge kutta methods, and interface the graph using processing. I dont understand "this" program language.

  • First figure out a pseudo code for calculating the voltage/current that you want to graph. Only then can you convert it to actual code.

  • Just to clarify, processing is good at displaying data (sort of). When it comes to calculations of this type, you will need to create your own algorithms (or search them on the web). Since you will be doing matrix operation or solving equations of some sort (my guess, I am not familiar with RK4 calculations), you might be better off working with octave (free) or matlab software.

    Kf

Sign In or Register to comment.