Azzera filtri
Azzera filtri

integration using two variables

2 visualizzazioni (ultimi 30 giorni)
Ramneet Sidhu
Ramneet Sidhu il 25 Ott 2019
Risposto: Walter Roberson il 25 Ott 2019
I have two expressions for variables a and x
M = (-150 + 20.556*x - ((1/2)*(x-10)^2 - (1/60)*(x-10)^3))*heaviside(20-x) + (5.556*x+(250/3))*heaviside(x-20);
m = (a*(1-x/30))*heaviside(20-a) + (x*(1-a/30)*heaviside(20-x) + a*(1-x/30)*heaviside(x-20))*heaviside(a-20);
And another expression
Mm = M*m;
I want to integrate Mm with respect to x treating a as a constant from x = 0 to x = 30. How can i do it?

Risposte (1)

Walter Roberson
Walter Roberson il 25 Ott 2019
Use the symbolic toolbox
syms x a
M = (-150 + 20.556*x - ((1/2)*(x-10)^2 - (1/60)*(x-10)^3))*heaviside(20-x) + (5.556*x+(250/3))*heaviside(x-20);
m = (a*(1-x/30))*heaviside(20-a) + (x*(1-a/30)*heaviside(20-x) + a*(1-x/30)*heaviside(x-20))*heaviside(a-20);
Mm = M*m;
result = simplify( int(expand(Mm), x, 0, 30) );

Community Treasure Hunt

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

Start Hunting!

Translated by