Integration with symbolic boundaries

5 views (last 30 days)
i have a polynomial in z and would like to integrate w.r.t. z between 0 and (h+d) where h is a known value and d is unknown and therefore symbolic. Is there any function in matlab that would allow me to do this?
here is what i have tried
function [Pa,Za,Pp,Zp,Residual_d,Tie_rod_force] = calculate_thrusts_and_their_locations(Qa,Qp,gamma_b_a,gamma_b_p,h0,h,Cd,Phi_d,Ka,Kp,Z0)
syms d z
AVS = Qa + gamma_b_a*z;
AHS = -2*Cd*sqrt(Ka) + Ka*AVS;
PVS = Qp + gamma_b_p*d;
PHS = 2*Cd*sqrt(Kp) + Kp*PVS;
Pa = INT(AHS,z,Z0,(h+d));
Za = (INT((z*Pa),z,Z0,(h+d)))/Pa;
Pp = INT(PHS,z,0,d);
Zp = (INT((z*Pp),z,0,d))/Pp;
Residual_d = Pa*Za - Pp*Zp;
Tie_rod_force = Pa - Pp;
end
all the inputs of this function are numerical values!

Accepted Answer

Walter Roberson
Walter Roberson on 28 Nov 2011
The symbolic toolbox int() should be able to handle that. Of course the values you get out will not necessarily be easily expressed.
Why are you dividing Za by Pa when it is constructed, and dividing Zp by Pp when that is constructed, but then multiplying by those factors again when calculating the Residual_d ?
  1 Comment
Richard
Richard on 30 Nov 2011
thanks ive changed INT() to int() and it is working now.
im not actually diving Za by Pa and Zp by Pp;
Pa = the area under a curve between 2 limits
Za = (integral of the 1st moment of area (z*Pa))/(the area(Pa))
and this is the location of the centroid of the shape created by the axis, the curve, and the 2 limits.
and the same for Zp and Pp but for a different curve and limits.
and i need the posistion of the centroids for other calculations.
i then multiply Za by Pa and Zp by Pp when calculating the residudal as the the residual is the summation of moments which provides me with a formula i can utilise to find a minimum value of d.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!