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

Click For Summary
SUMMARY

The discussion focuses on implementing the Laplace transform T(s) = 1/(s+1) in C programming. Key insights include using the float data type for variables and taking user input for the variable 's'. The final calculation can be expressed as final = (1/s) + 1, which is printed using printf. For symbolic manipulation or numerical solutions, users are advised to consider MATLAB or explore existing libraries for numerical Laplace transforms.

PREREQUISITES
  • Understanding of C programming syntax and data types
  • Familiarity with mathematical concepts of Laplace transforms
  • Basic knowledge of user input handling in C
  • Experience with numerical methods or libraries for mathematical computations
NEXT STEPS
  • Research C libraries for numerical Laplace transforms
  • Learn about symbolic computation in MATLAB for Laplace transforms
  • Explore advanced numerical methods for solving differential equations
  • Investigate data type precision and performance optimization in C
USEFUL FOR

Students, engineers, and developers interested in numerical methods, particularly those implementing mathematical transformations in C programming.

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.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
10
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
7
Views
6K
  • · Replies 4 ·
Replies
4
Views
2K