이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
hi there i want to get the values of A1,A2,A2,Q1,Q2,Q3 , i have six equations and six initial conditions as Xo, Vo kindly suggest me solution
조회 수: 3 (최근 30일)
이전 댓글 표시
for i = 1:1:3
x(t) = U(i,1)*A1*cos(w2(1,1)*t + Q1) + U(i,2)*A2*cos(w2(2,2)*t + Q2) +U(i,3)*A3*cos(w2(3,3)*t + Q3);
x= x(t);
v= diff(x(t));
end
x
v
Xo = [1 0 0]
Vo = [0 0 0]
% eqns = [x(1,1) == Xo(1,1) , x(1,2) == Xo(1,2), x(1,3) == Xo(1,3), v(1,1) == Vo(1,1) , v(1,2) == Vo(1,2), v(1,3) == Vo(1,3)];
% S = solve(eqns,[A1 A2 A3 Q1 Q2 Q3])
채택된 답변
Walter Roberson
2022년 8월 2일
for i = 1:1:3
x{i} = U(i,1)*A1*cos(w2(1,1)*t + Q1) + U(i,2)*A2*cos(w2(2,2)*t + Q2) +U(i,3)*A3*cos(w2(3,3)*t + Q3);
v{i} = diff(x{i}, t);
end
Xo = [1 0 0]
Vo = [0 0 0]
eqns = [x{1} == Xo(1,1) , x{2} == Xo(1,2), x{3} == Xo(1,3), v{1} == Vo(1,1) , v{2} == Vo(1,2), v{3} == Vo(1,3)];
S = solve(eqns,[A1 A2 A3 Q1 Q2 Q3])
댓글 수: 14
Rahul Jangid
2022년 8월 2일
thanks for that but it is not showing me exact value
it is showing as
S =
struct with fields:
A1: [0×1 sym]
A2: [0×1 sym]
A3: [0×1 sym]
Q1: [0×1 sym]
Q2:
[0×1 sym]
Q3: [0×1 sym]
what should i change ???
Rahul Jangid
2022년 8월 2일
편집: Walter Roberson
2022년 8월 2일
U = [
-0.3280 0.7370 -0.5910
-0.5910 0.3280 0.7370
-0.7370 -0.5910 -0.3280]
w2 = [
0.1981 0 0
0 1.5550 0
0 0 3.2470]
Walter Roberson
2022년 8월 2일
syms A1 A2 A3 Q1 Q2 Q3 t
U = [
-0.3280 0.7370 -0.5910
-0.5910 0.3280 0.7370
-0.7370 -0.5910 -0.3280]
w2 = [
0.1981 0 0
0 1.5550 0
0 0 3.2470]
for i = 1:1:3
x{i} = U(i,1)*A1*cos(w2(1,1)*t + Q1) + U(i,2)*A2*cos(w2(2,2)*t + Q2) +U(i,3)*A3*cos(w2(3,3)*t + Q3);
v{i} = diff(x{i}, t);
end
Xo = [1 0 0]
Vo = [0 0 0]
eqns = [x{1} == Xo(1,1) , x{2} == Xo(1,2), x{3} == Xo(1,3), v{1} == Vo(1,1) , v{2} == Vo(1,2), v{3} == Vo(1,3)];
S = solve(eqns,[A1 A2 A3 Q1 Q2 Q3])
This gets me 8 solutions when I test.
Note that if really your U or w2 have more digits of precision than you posted, then it is possible that due to small differences in the values that there might not be any solutions.
Rahul Jangid
2022년 8월 2일
bro i need to finally find the response curve for all three masses and plot x1,x2,x3 wrt. t
so here is my code please help
%% Intoroduction of variables
syms m k F1 F2 F3 A1 A2 A3 Q1 Q2 Q3 t
%% Value submission
m=1;
k=1;
% w=1;
%% Mass, Stiffness AND Force matrices
M=[m 0 0
0 m 0
0 0 m];
K = [2*k -k 0
-k 2*k -k
0 -k k] ;
%% Equation of motion
format short
[U,w2] = eig(K,M)
%% Response of the system (here A and Q shows the amplitude and phase difference)
format short
for i = 1:1:3
x(t) = U(i,1)*A1*cos(w2(1,1)*t+Q1) + U(i,2)*A2*cos(w2(2,2)*t+Q2) +U(i,3)*A3*cos(w2(3,3)*t+Q3);
x= x(t);
v= diff(x);
end
x
v
Xo = [1 0 0];
Vo = [0 0 0];
% eqns = [x(1,1) == Xo(1,1) , x(1,2) == Xo(1,2), x(1,3) == Xo(1,3), v(1,1) == Vo(1,1) , v(1,2) == Vo(1,2), v(1,3) == Vo(1,3)];
eqns = [x(1,:) == Xo(1,:) , v(1,:) == Vo(1,:)]'
sol = vpasolve(eqns)
Rahul Jangid
2022년 8월 2일
in previous code w^2 is there so i have corrected it please use this as correct equation
x(t) = U(i,1)*A1*cos(sqrt(w2(1,1))*t+Q1) + U(i,2)*A2*cos(sqrt(w2(2,2))*t+Q2) +U(i,3)*A3*cos(sqrt(w2(3,3))*t+Q3);
Sam Chak
2022년 8월 2일
Rahul, I guess you want to formulate the equations of motion, which are a coupled set of differential equations. Please confirm.
Otherwise, the way you described your problem can be confusing.
Rahul Jangid
2022년 8월 2일
No i have already formulated the equ. of motion thats why i m able to write mass and stiffness matrix
than i found natural frequencies and modes also
then as we know that response of system is summation of natural modes so i have derived x(t) from this i can find displacement of all the masses with respect to time.
so finally i want the displacements of all the masses (to find out the unknowns i have also given initial conditions )
if u have any other idea to get the response curve please suggest me or else help me to find out those displacement equations.
Walter Roberson
2022년 8월 2일
편집: Walter Roberson
2022년 8월 2일
%% Intoroduction of variables
syms m k F1 F2 F3 A1 A2 A3 Q1 Q2 Q3 t
%% Value submission
m=1;
k=1;
% w=1;
%% Mass, Stiffness AND Force matrices
M=[m 0 0
0 m 0
0 0 m];
K = [2*k -k 0
-k 2*k -k
0 -k k] ;
%% Equation of motion
format short
[U,w2] = eig(K,M)
U = 3×3
-0.3280 0.7370 -0.5910
-0.5910 0.3280 0.7370
-0.7370 -0.5910 -0.3280
w2 = 3×3
0.1981 0 0
0 1.5550 0
0 0 3.2470
%% Response of the system (here A and Q shows the amplitude and phase difference)
format short
for i = 1:1:3
x{i} = U(i,1)*A1*cos(w2(1,1)*t+Q1) + U(i,2)*A2*cos(w2(2,2)*t+Q2) +U(i,3)*A3*cos(w2(3,3)*t+Q3);
v{i} = diff(x{i}, t);
end
x
x = 1×3 cell array
{[(6638091741507547*A2*cos(Q2 + (7002908864245409*t)/4503599627370496))/9007199254740992 - (2661668130624679*A3*cos(Q3 + (913943508336349*t)/281474976710656))/4503599627370496 - (5908457496031831*A1*cos(Q1 + (3567972556901945*t)/18014398509481984))/18014398509481984]} {[(2954228748015915*A2*cos(Q2 + (7002908864245409*t)/4503599627370496))/9007199254740992 + (1659522935376887*A3*cos(Q3 + (913943508336349*t)/281474976710656))/2251799813685248 - (332708516328085*A1*cos(Q1 + (3567972556901945*t)/18014398509481984))/562949953421312]} {[- (5323336261249361*A2*cos(Q2 + (7002908864245409*t)/4503599627370496))/9007199254740992 - (2954228748015915*A3*cos(Q3 + (913943508336349*t)/281474976710656))/9007199254740992 - (6638091741507549*A1*cos(Q1 + (3567972556901945*t)/18014398509481984))/9007199254740992]}
v
v = 1×3 cell array
{[(2432614309330170770701412156971*A3*sin(Q3 + (913943508336349*t)/281474976710656))/1267650600228229401496703205376 - (46485951498277445065388233601723*A2*sin(Q2 + (7002908864245409*t)/4503599627370496))/40564819207303340847894502572032 + (21081214199463155606688465811295*A1*sin(Q1 + (3567972556901945*t)/18014398509481984))/324518553658426726783156020576256]} {[(1187094855706169954794794625325*A1*sin(Q1 + (3567972556901945*t)/18014398509481984))/10141204801825835211973625643008 - (1516710213722988286690676565563*A3*sin(Q3 + (913943508336349*t)/281474976710656))/633825300114114700748351602688 - (20688194686489267889392397684235*A2*sin(Q2 + (7002908864245409*t)/4503599627370496))/40564819207303340847894502572032]} {[(37278838691262164489772848433649*A2*sin(Q2 + (7002908864245409*t)/4503599627370496))/40564819207303340847894502572032 + (2699998186389765280096224994335*A3*sin(Q3 + (913943508336349*t)/281474976710656))/2535301200456458802993406410752 + (23684529163896374554619270282805*A1*sin(Q1 + (3567972556901945*t)/18014398509481984))/162259276829213363391578010288128]}
Xo = [1 0 0];
Vo = [0 0 0];
% eqns = [x(1,1) == Xo(1,1) , x(1,2) == Xo(1,2), x(1,3) == Xo(1,3), v(1,1) == Vo(1,1) , v(1,2) == Vo(1,2), v(1,3) == Vo(1,3)];
eqns = [x{1} == Xo(1,1) , x{2} == Xo(1,2), x{3} == Xo(1,3), v{1} == Vo(1,1) , v{2} == Vo(1,2), v{3} == Vo(1,3)];
sol = solve(eqns, [A1 A2 A3 Q1 Q2 Q3])
sol = struct with fields:
A1: [8×1 sym]
A2: [8×1 sym]
A3: [8×1 sym]
Q1: [8×1 sym]
Q2: [8×1 sym]
Q3: [8×1 sym]
cross_check = subs(lhs(eqns) - rhs(eqns), sol)
cross_check =

structfun(@(S)disp(vpa(S,10)), sol)






Remember that when you use diff() and you do not specify which variable to take the derivative, that MATLAB chooses a variable for you.
Also remember that you are trying to vpasolve() 8 equations in 9 variables (with t being the extra variable)
Sam Chak
2022년 8월 2일
Okay, @Rahul Jangid. Thanks for your clarification. You want to find the solutions for
so that you can plot
. What do the 8 sets of
tell you? How would you choose a unique set of solution?
Rahul Jangid
2022년 8월 3일
thanks for your efforts , i have reached to the sol. from your suggestions.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)
