How to integrate a function inside a ssc ?

2 Ansichten (letzte 30 Tage)
Léo Jan
Léo Jan am 20 Dez. 2022
Bearbeitet: Torsten am 4 Jan. 2023
Hi,
I would like to perform a integration inside a ssc code (so in the Simscape environment not the matlab one) but i did not find how to do it and if it's possible. I'm not talking about a integration over time for which I already found something.
My function looks like that 1/(0.05+0.015 exp(100x)), a primitive of this function is not very easy to find, this is why i would like to integrate between 0 and let's say 0.01. Furthermore, my function could change a bit.
Is there a way to do that ?
Thanks,
Léo

Antworten (1)

Torsten
Torsten am 20 Dez. 2022
syms x
f = 1/(0.05+0.015*exp(100*x));
int(f)
ans = 
  6 Kommentare
Léo Jan
Léo Jan am 4 Jan. 2023
You're right, in my case, it doesn't change during the simulation.
So i will use the tool you've linked.
Should I understand that the integration is impossible in a ssc file ?
Torsten
Torsten am 4 Jan. 2023
Bearbeitet: Torsten am 4 Jan. 2023
Should I understand that the integration is impossible in a ssc file ?
Up to now, I thought that the missing symbolic toolbox was the problem.
I know symbolic computations are not possible in ssc files, but since you don't have the symbolic toolbox ...
Once you have the equation for the integral, you can use it in an ssc file as a function handle.
So in short: I don't know what your question aims at (i.e. what problems you encounter when you try to integrate in an ssc file).
Maybe it can be answered here:

Melden Sie sich an, um zu kommentieren.

Produkte


Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by