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

AI Thread Summary
To implement a Laplace transform in C or C++, the discussion suggests using float data types for variables. The example provided, T(s) = 1/(s+1), can be calculated by prompting the user for the value of 's' and then performing the calculation using simple arithmetic. The formula can be expressed as final = (1/s) + 1, and the result can be printed using printf. For more complex symbolic manipulations or numerical computations, it is recommended to consider using a dedicated library or sticking with MATLAB, as it is more suited for such tasks. If further issues arise, participants are encouraged to seek additional help.
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
:)
 
Technology 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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top