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

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 11K views
khayabi
Messages
1
Reaction score
0
[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
:)
 
Physics news on Phys.org


khayabi said:
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
:)

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.
 


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.