1 / 32

Mixing problem with 5 tanks

Mixing problem with 5 tanks . Team2. Contents. - Problem. - Codes / Results. - Conclusion. - Further. Problem. Find the amount of salt in each tank at time t = 5, 10, 15, 20, 30 (min) , and plot the salt content function at each time step t. r (gal/min). t ank 1. t ank 2. t ank 3.

colby
Download Presentation

Mixing problem with 5 tanks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mixing problem with 5 tanks Team2

  2. Contents - Problem - Codes / Results - Conclusion - Further

  3. Problem Find the amount of salt in each tank at time t = 5, 10, 15, 20, 30(min), and plot the salt content function at each time step t. r (gal/min) tank 1 tank 2 tank 3 tank 4 tank 5 r r r r r V1 (gal) V2 (gal) V3 (gal) V4 (gal) V5 (gal) With V1 = 20, V2 = 25, V3 = 30, V4 = 35, V5 = 40, r = 10(gal/min), and x1(0) = 10, x2(0) = x3(0) = x4(0) = x5(0) = 0

  4. Problem

  5. Problem where

  6. QR - Code A=[-1/2,0,0,0,0;1/2,-2/5,0,0,0;0,2/5,-1/3,0,0; 0,0,1/3,-2/7,0;0,0,0,2/7,-1/4]; [Q,R]=qr(A); A(:,6:10)=R*Q; k=2; pause while norm(diag(A(:,5*k-4:5*k))-diag(A(:,5*k-9:5*k-5))) /norm(diag(A(:,5*k-4:5*k)))>0.0001 [Q,R]=qr(A(:,5*k-4:5*k)); A(:,5*k+1:5*k+5)=R*Q; k=k+1; end

  7. QR - Result tol

  8. QR - Result tol

  9. QR - Result tol

  10. QR - Result tol

  11. QR - Result tol

  12. Power - Code A=[-1/2,0,0,0,0;1/2,-2/5,0,0,0;0,2/5,-1/3,0,0; 0,0,1/3,-2/7,0;0,0,0,2/7,-1/4]; q=[1,1,1,1,1]'; eg=q'*A*q; z=A*q; q(:,2)=z/norm(z); eg(2)=q(:,2)'*A*q(:,2); E1=norm(q(:,2)-q(:,1))/norm(q(:,2)); E2=(eg(2)-eg(1))/eg(2); k=2; t=0

  13. Power - Code whilet==0 z=A*q(:,k); q(:,k+1)=z/norm(z); eg(k+1)=q(:,k+1)'*A*q(:,k+1); k=k+1; if norm(q(:,k)-q(:,k-1))/norm(q(:,k))<0.0001 break elseif norm(q(:,k)+q(:,k-1))/norm(q(:,k))<0.0001 break end end end

  14. Power - Result tol Conv. rate

  15. Inverse - Code A=[-1/2,0,0,0,0;1/2,-2/5,0,0,0;0,2/5,-1/3,0,0; 0,0,1/3,-2/7,0;0,0,0,2/7,-1/4]; q=[1,1,1,1,1]'; eg=q'*A*q; z=A\q; q(:,2)=z/norm(z); eg(2)=q(:,2)'*A*q(:,2); k=2; t=0

  16. Inverse - Code whilet==0 z=A\q(:,k); q(:,k+1)=z/norm(z); eg(k+1)=q(:,k+1)'*A*q(:,k+1); k=k+1; if norm(q(:,k)-q(:,k-1))/norm(q(:,k))<0.0001 break elseif norm(q(:,k)+q(:,k-1))/norm(q(:,k))<0.0001 break end end end

  17. Inverse - Result tol Conv. rate

  18. Shifted Inverse - Code A=[-1/2,0,0,0,0;1/2,-2/5,0,0,0;0,2/5,-1/3,0,0; 0,0,1/3,-2/7,0;0,0,0,2/7,-1/4]; q=[1,1,1,1,1]'; B=A+0.375*eye(5); eg=q'*A*q; z=B\q; q(:,2)=z/norm(z); eg(2)=q(:,2)'*A*q(:,2); k=2; t=0

  19. Shifted Inverse - Code whilet==0 z=B\q(:,k); q(:,k+1)=z/norm(z); eg(k+1)=q(:,k+1)'*A*q(:,k+1); k=k+1; if norm(q(:,k)-q(:,k-1))/norm(q(:,k))<0.0001 break elseif norm(q(:,k)+q(:,k-1))/norm(q(:,k))<0.0001 break end end end

  20. Shifted Inverse – Result1 sigma=-0.375 tol Conv. rate

  21. Shifted Inverse – Result2 sigma=-0.325 tol Conv. rate

  22. Shifted Inverse – Result3 sigma=-0.2915 tol Conv. rate

  23. Conclusion

  24. Conclusion Tank1

  25. Conclusion Tank2

  26. Conclusion Tank3

  27. Conclusion Tank4

  28. Conclusion Tank5

  29. Further whilet==0 z=B\q(:,k); q(:,k+1)=z/norm(z); eg(k+1)=q(:,k+1)'*A*q(:,k+1); k=k+1; if norm(q(:,k)-q(:,k-1))/norm(q(:,k))<0.0001 break elseif norm(q(:,k)+q(:,k-1))/norm(q(:,k))<0.0001 break end end end

  30. Further whilet==0 z=B\q(:,k); q(:,k+1)=z/norm(z); eg(k+1)=q(:,k+1)'*A*q(:,k+1); B=A-eg(k+1)*eye(5); k=k+1; if norm(q(:,k)-q(:,k-1))/norm(q(:,k))<0.0001 break elseif norm(q(:,k)+q(:,k-1))/norm(q(:,k))<0.0001 break end end end

  31. Further tol = - Shifted Inverse with fixed sigma # of iterations = 21 - Shifted Inverse with updated sigma # of iterations = 9

  32. Q&A

More Related