v=0.001;
L=0.084;
D=0.042;
R=0.02;
C=0.001;
sm= v*N*L*R*L^2/(4*W*C^2);
sm=(1-p^2)^2/p*((16*p^2+pi^2*(1-p^2))^0.5;
p=?

 채택된 답변

Star Strider
Star Strider 2022년 7월 31일
편집: Star Strider 2022년 7월 31일

1 개 추천

I have no idea what you want, especially with two expressions for ‘sm’ and several variables undefined, so taking a wild guess —
syms N W p
sympref('AbbreviateOutput',false);
v=0.001;
L=0.084;
D=0.042;
R=0.02;
C=0.001;
sm1 = v*N*L*R*L^2/(4*W*C^2);
sm = (1-p^2)^2/p*(16*p^2+pi^2*(1-p^2))^0.5 == sm1;
ps = solve(sm, p, 'ReturnConditions',1)
ps = struct with fields:
p: [10×1 sym] parameters: [1×0 sym] conditions: [10×1 sym]
p = ps.p
p = 
condx = ps.conditions
condx = 
To get a numerical result, supply values for the currently undefined variables, then one of these:
p = vpa(ps.p)
p = double(ps.p)
depending on the desired result.
EDIT — Corrected typographical error. .

댓글 수: 6

Gloria
Gloria 2022년 7월 31일
Thank you for the answer ;
I asked the question wrong actually. I am trying the draw sommerfeld number-eccentricity graph.
The x-axis of the graph is between 0 and 1 which is given with "p", and the y-axis is the equation "(1-p^2)^2/p*(16*p^2+pi^2*(1-p^2))^0.5" that depends on the p. How can I draw this graph?
With the missing variables supplied, one approach to drawing the plot would be:
sm1 = v*N*L*R*L^2/(4*W*C^2);
sm(p) = (1-p^2)^2/p*(16*p^2+pi^2*(1-p^2))^0.5 - sm1;
figure
fplot(sm, [0 1])
grid
See the documentation for fplot for more infoormation on it.
Another option (not using the Symbolic Math Toolbox) would be —
v=0.001;
L=0.084;
D=0.042;
R=0.02;
C=0.001;
N = ; % Provide This Value
W = ; % Provide This Value
sm1 = v*N*L*R*L^2./(4*W*C^2);
sm = @ (p) (1-p.^2).^2./p.*sqrt(16*p.^2+pi^2.*(1-p.^2)) - sm1;
p = linspace(0, 1, 250);
figure
plot(p, sm(p))
grid
.
Gloria
Gloria 2022년 7월 31일
Thank you so much
Star Strider
Star Strider 2022년 7월 31일
My pleasure!
I still don’t understand how best to reconcile or combine the two expressions for ‘sm’. I ended up subtracting them because the original intent was to find ‘p’, however I still wonder what the intent is now.
.
Gloria
Gloria 2022년 7월 31일
Yes , in the first question I was trying to find "p" but later I realized that I understood the problem wrong.
I am trying the draw sommerfield number-eccentricity graph.
Thank you so much for your time.
Star Strider
Star Strider 2022년 7월 31일
My pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Matt J
Matt J 2022년 7월 31일
편집: Matt J 2022년 7월 31일

1 개 추천

Are N and W known variables? Your code does not provide them, but if they are known, you can reorganize as a polynomial and use roots,
v=0.001;
L=0.084;
D=0.042;
R=0.02;
C=0.001;
N=1;W=1; %fake
sm= v*N*L*R*L^2/(4*W*C^2);
syms p
pol=sym2poly( sm^2*p^2*(16*p^2+pi^2*(1-p^2)) - (1-p^2)^4 )
pol = 1×9
-1.0000 0 4.0000 0 -5.9999 0 4.0001 0 -1.0000
p=roots(pol) %the solutions
p =
-1.0550 + 0.0000i -0.9994 + 0.0544i -0.9994 - 0.0544i -0.9461 + 0.0000i 1.0550 + 0.0000i 0.9994 + 0.0544i 0.9994 - 0.0544i 0.9461 + 0.0000i

카테고리

도움말 센터File Exchange에서 Spline Postprocessing에 대해 자세히 알아보기

질문:

2022년 7월 31일

댓글:

2022년 7월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by