How can I solve multiple equations? (Pipeline Design)
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I need to Isolate out just calulate 't' from these equations.
The rest of the values are all given. But the equations are all connected to one another. and I just need to only find out what the value 't' is.
Pc = 1.324
specified minimum yield strength, = 448
v = 0.3
E=2.1*10^5
D = 304.8 mm (12 inches)
Pipe ovality, δ = I believe an if condition is enough to just extract out the values 0.75 or 1.0 based on the size of D
Note: Ignore Dmin and Dmax in this
Can anyone please help me with this? Thank you
1 commentaire
dpb
le 13 Juin 2021
Write a function to compute Pc, then use fsolve to find the critical t at which Pc - Pc_target =0
Réponse acceptée
dpb
le 13 Juin 2021
Modifié(e) : dpb
le 15 Juin 2021
function Pc=pipelineExternalPC(d,t,sy)
% Usage:
% Pc=pipelineExternalPC(d,t,sy)
%
% returns Pc, pipeline external collapse pressure(MPa) for pipe
% diameter and wall thickness; d, t in inches for specified minimum
% yield strength, sy (MPa)
E=207E3; % Young's modulus, steel (MPa)
nu=0.30; % Poisson's ratio
ovality=(0.75+0.25*(d>=20))/100; % ovality correction factor
D=25.4*d; t=25.4*t; % convert dimensions to mm
tOD=t/D; % thickness/diameter ratio
d=ovality/tOD; % diameter to thickness ratio
g=@(r,d)(sqrt(1-d*d)-d)*sqrt(1+r*r)/sqrt(1+r*r*sqrt(1+d*d)-d*d);
Pe=2*E*tOD^3/(1.4*(1-nu*nu)*(1-tOD)^2);
Py=2*sy*tOD;
r=Py/Pe;
Pc=g(r,d)*Py*Pe/hypot(Py,Pe);
end
Now write an anonymous function to solve for the specific condition given the constraints...
>> fn=@(t)pipelineExternalPC(12,t,448)-1.324
fn =
function_handle with value:
@(t)pipelineExternalPC(12,t,448)-1.324
>> fsolve(fn,0.25)
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
ans =
0.2576
>> pipelineExternalPC(12,ans,448)
ans =
1.3240
>>
NB: The result is in inches, the input dimensions units presumed in writing the function.
2 commentaires
Ahmed Mohamed Mansoor
le 13 Juin 2021
Modifié(e) : Ahmed Mohamed Mansoor
le 13 Juin 2021
dpb
le 15 Juin 2021
Modifié(e) : dpb
le 15 Juin 2021
ovality=(1.-0.25*(Di<20)); % ovality correction factor
You did catch the inverted logic test for size to use 1% for larger diameter pipes; good catch.
I decided the better form would be to write as
ovality=(0.75+0.25*(Di>=20)); % ovality correction factor
to add 1/4% for the larger diameter instead of taking it off the smaller. Seems to read better; make more sense to the humans; the computer doesn't care! :)
However, the above introduced a mistake by not converting the percentage to absolute numbers.
It's defined explicitly as the ratio
[Dmax-Dmin]/Dnominal --> [Dmax-Dmin]/{[Dmin+Dmax]/2} ==> 2*[Dmax-Dmin]/[Dmin+Dmax]
which is absolute ratio; expressed in % it's 100X that number.
NB: that the formula in the reference is missing the factor of two for the nominal divisor if computed from actual pipe measurements.
But, you've introduced a factor of 100 too large a value by removing the divisor from the numbers entered as percentages in the function.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Control System Toolbox dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!