Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

[Ask] How to write laplace transform in c or c++ ?

  1. Jul 5, 2011 #1
    [Ask] How to write laplace transform in c or c++ ??

    Hi Guys..
    if I have a laplace transform example : T(s) = 1/s+1. It's easy to solve or write in Matlab, but how to write it in C programm ??

    thanks
    :)
     
  2. jcsd
  3. Jul 5, 2011 #2
    Re: [Ask] How to write laplace transform in c or c++ ??

    Take all variable with float data type.
    Take s from user.
    tempstore = (1/s);
    final = tempstore+1;

    or can be written as

    final = (1/s) + 1;
    printf("%f",final);
    getch();
    }

    If problems still persist then tell me.
     
  4. Jul 6, 2011 #3

    MATLABdude

    User Avatar
    Science Advisor

    Re: [Ask] How to write laplace transform in c or c++ ??

    Welcome to PhysicsForums!

    Are you asking how to implement a Laplace transform, how to use and manipulate it symbolically in systems analysis (as in MATLAB), or how to produce values for various s values as Keyur suggests?

    If the first, you can probably find a library that can do a numerical Laplace transform. If the second, you should probably stick to MATLAB, and if the third, well, there's something above.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook