matlab代写

ACS6101: Foundations of Control Systems

Period: Weeks 1-3
Dr Viktor Fedun (v.fedun@sheffield.ac.uk, Room C9 Amy Johnson Building)
Dr George Panoutsos (g.panoutsos@sheffield.ac.uk, Room C6a Amy Johnson Building)

Assignment weighting

50%

Assignment released

Week 2

Assignment Due and Submission Instructions

End of Week 6 (Sunday midnight). You must submit the completed assignment to the relevant ACS6101 MOLE page, via Turnitin, as a single document (Part A + Part B). You must include your registration number at the top of every page. Your report should be word processed, using minimum size font 11, minimum 2.5cm margins all around.

Penalties for Late Submission

Late submissions will incur the usual penalties of a 5% reduction in the mark for every working day (or part thereof) that the assignment is late and a mark of zero for submission more than 5 working days late. For more information see http://www.shef.ac.uk/ssid/exams/policies.

Feedback

No later than two weeks after the submission deadline. The feedback will include the overall mark, individual component marks as well as written comments on performance on the assignment (electronic format). You will also have the opportunity for one-to-one feedback. General feedback on the whole class performance will also be provided via email and on MOLE. Note that final marks may be subject to change as a result of unfair means.

Unfair Means

The assignment should be completed individually. You should not discuss the assignment with other students and should not work together in completing the assignment. The assignment must be wholly your own work. References must be provided to any other work that is used as part of this assignment. Any suspicions of the use of unfair means will be investigated and may lead to penalties. See http://www.shef.ac.uk/ssid/exams/plagiarism for more information.

Special Circumstances

If you have medical or personal circumstances which cause you to be unable to submit this assignment on time or that may have affected your performance, please complete and submit a special circumstances form along with documentary evidence of the circumstances. See: http://www.shef.ac.uk/ssid/forms/special

particularly noting point 6 (Medical Circumstances affecting Examinations/Assessment).

Help

This assignment briefing, the lecture notes, and the laboratory handouts (all available on MOLE) provide all the information that is required to complete this assignment. It is not expected that you should need to ask further questions. Remember that you need to decide on what is the most appropriate approach to carry out the simulations and present your results. This is also part of what you are being assessed on and will assess your knowledge and understanding of the taught material for ACS6101. However, if you need clarifications on the assignment then please feel free to email the relevant lecturer.

You must complete both parts of the assignment !

Part A (25% of overall module mark – content from Week 1)

Marking Criteria: Apportioned Marks for questions are Q1: 5%, Q2: 8%, Q3: 12%

In doing the assignment Part A, you should be prepared to use the MatLab help system and the course notes, and to do some of your own research to learn about functions or features you may need.

Your answers should consist of the code used to solve the problem and example output where appropriate. Graphs or pictures should be saved in .png format. The code should be headed with comments that include the title, description of the purpose of the code and an explanation that guides the reader through the workings of the code. Comments should also include the question number, your name and the date the code was finished. There is no limit to code length, but the work should not require more than 20-30 lines of code for each problem.

Put all of your code, output and plots into a report (PDF file format) which you will

submit via Turnitin, as a single document (Part A + Part B). Your codes must also be submitted as separate .m files (MatLab scripts and function) to Dr. V. Fedun via e-mail : v.fedun@sheffield.ac.uk.

You may discuss with other students how to approach each problem, but you must write all your own code and all your own report. Your submission will be checked for plagiarism using turnitin.

For each question, marks will be awarded for:

  • the quality of your description;
  • whether your code runs or not;
  • elegance and design (show that you have thought about the best way to

    solve the problem);

  • simplicity and clarity (simple and clear is better, sensible variable names,

    formatting, comments etc.);

  • readability (description, indenting, presentation, comments etc);
  • correctness (giving exactly the right answers);
  • consistency.

    Question 1

    Write a script to create the following matrices and vector y: −2 −4 2 −2 4 2 1

!−2 1 2( ! 2 5 6( 𝑦=!−2( 425 −484 2

Your script should ask for input from the user to choose one of the matrices and assign it to a variable A. The script should then, if the determinant of A is nonzero, find the eigenvalues and eigenvectors of A and the solution x to the equation Ax=y, or display an appropriate message otherwise. Your script should also clear the workspace and command window at the start of each run and output all results to the command window.

Question 2

A simple harmonic oscillator, modelled by the equation 𝑥̈ + 𝑤1𝑥 = 0, can be expressed as two first order equations 𝑦3̇ = 𝑦1 and 𝑦1̇ = −𝑤1𝑦3 (after setting 𝑦1 = 𝑥̇ and 𝑦3 = 𝑥).

In vector form it becomes: 5 7𝑦38 = 9 𝑦1 : 56 𝑦1 −𝑤1𝑦3

Create a m-file function called sho that takes three input args and returns one output arg. The input args are t, y, w. The output arg is a two column vector dy computed within the body of the function as shown in the equation above.

Write a script that calls the matlab function ode45 to obtain a solution over a time interval [0 20] with w=0.3 and initial conditions 𝑦3(0) = 𝑥(0) = 1, metres, and

𝑦1(0) = 𝑥̇(0) = 0, metres/sec.

Your script should then plot the first column of the returned solution (i.e. y1) vs time and plot the first column of the returned solution vs the second column of the returned solution. Both plots should be arranged as subplots in one figure. On the second plot mark the starting point with an asterisk marker and the last point with a diamond marker. Label your plots appropriately.

Hint: call ode45 with the function sho in anonymous function style rather than as a string as shown in Matlab Help.

Question 3

Write a script to plot of a ring torus using the parametric equations: 𝑥=(𝑐+𝑎cos(𝑣))cos(𝑢) ; 𝑦=(𝑐+𝑎cos(𝑣))sin(𝑢) ; 𝑧=𝑎sin(𝑣) ;

where c is the radius from the center of the hole to the center of the torus tube and a is the radius of the tube. In your script set c=3, a=1, 𝑐 = 3, 𝑎 = 1, 𝑣 is 100 linearly spaced points (−𝜋 ≤ 𝑣 ≤ 𝜋) and u is 100 linearly spaced points (0 ≤ 𝑢 ≤ 2𝜋).
In your plot, set the surface of the torus to have FaceColor =’interp’, FaceAlpha=0.25 and EdgeAlpha=0.1. Give your plot a title and add axes labels. Assume dimensions are in units of mm. Add a colorbar.

On the same plot, add a blue coloured cross-section circle with LineWidth=2 at the start of the torus and another one at half way around. (Circles drawn using the same points used for the torus).
Then on the same plot, replot one half of torus – i.e half from one circle to the other – with a ‘FaceAlpha’=1 and ‘EdgeAlpha’ =0.5. Also add a text box positioned at x=2.5, y=3, z=1 to your plot to show the calculation of half the surface area of the torus. Text should be 9pt size, courier font. Set the view to have an azimuth of -44 and elevation of 44.

Save your script for all the above as question3a.
Next, add to your script to produce an animation of the differently shaded half torus,

moving from one side of the torus to gradually occupy the other half of the torus. Save your script with the additional animation as question3b.

(Note: The surface area of a torus is given by the equation: 𝑆 = 4𝜋1𝑎𝑐 )

Part B (25% of overall module mark – content from Week 2)

THIS PART OF THE ASSIGNMENT MUST BE COMPLETED IN 8 SIDES OF A4 PAPER. NO MARKS WILL BE AWARDED FOR SOLUTIONS BOYOND THE LIMIT OF 8 SIDES.

This assignment/report will assess your fundamental understanding of systems modelling and simulation, including basic use of MATLAB/Simulink. The assignment is based on the whole content of Week 2, part of ACS6101

The assignment is divided into two sections: B1) Basic concepts B2) Advanced concepts. The expectation is for section B1 to assess your understanding of the basic concepts in the module and associated learning objectives, while section B2 is to challenge your understanding in more advanced topics.

In your report you need to address all questions in each part, include your working methodology, the resulting Matlab/Simulink plots/diagrams, and brief discussion of the results.

Marking Criteria

This this is the marksheet (below) that will be used to assess the assignment. The marksheet indicates the marks available for each part of the assignment and also indicates some of the factors that will be used in assessing the quality/correctness of your work. It is strongly recommended that you study this marksheet before completing the assignment.

Assignment Task

Marking Guideline

Apportioned Mark

Section B1

Task 1

This is a theory-related task, marks will be awarded for demonstration of correct understanding of the topic

5%

Task 2

This is a theory-related task, which also includes a practical aspect. Marks will be awarded for demonstration of correct understanding of the topic as well as correct final solution and methodology.

5%

Section B2

Task 1

This is a theory-related task, marks will be awarded for demonstration of correct understanding of the topic

5%

Task 2

This is a theory-related task, which also includes a practical aspect. Marks will be awarded for demonstration of correct understanding of the topic as well as correct final solution and working out methodology.

8%

Overall Report for Part B

To assess your report writing skills, marks will be awarded for report structure, clarity of writing, use of figures/pictures as well as references.

2%

Total: 25%

Please answer all questions in Section B1 and Section B2. Section B1
Task 1

Derive a linear approximation mathematical model of the pendulum system shown in Figure 1 to describe the relationship between the torque developed on the mass M and the angle theta between the rod and the vertical plane. State clearly your assumptions and your modelling methodology.

Figure B 1

Task 2
For the mechanical system (simplified car suspension) shown in Figure 2:

a. Derive the mathematical model of the system to describe the displacement associated with the three masses M1 (wheel), M2 (chassis) and M3 (car seat).

b. Derive the transfer function model of the system, and represent it in its matrix form.

c. Derive the state space representation of the system, and represent it in its state space matrix format.

Clearly state any assumptions you may make.

Figure B 2

Section B2

Task 1

What is a signal flow graph, and how does it compare against the block diagram representation? For the system modelled in Part A, Task 2 derive the signal flow graph (working methodology and diagram).

Task 2

In this part of the assignment the aim is to study the behaviour of a dynamic system, via modelling and simulation methods.

Using the ACS6101 handout “Practical simulation experiments using SIMULINK” select one system only for this part of the assignment. You must follow the rule:

“Sum all the numbers of your student registration number (you can find this in you U-card) to a single digit (ODD/EVEN NUMBER), then select a system according to the list provided below.”

For example: Student ID: 0123456789, sum of all digits: 0+1+2+3+4+5+6+7+8+9 = 45, 4+5 = 9 (ODD NUMBER), System: 1: Depth Control for a Torpedo.

System selection List:

System 1. (ODD NUMBER) Depth Control for a Torpedo

System 2. (EVEN NUMBER) Control System for a Heating Process

(you need to show in your report the above calculation and the resulting system that is selected for analysis)

For the simulation system, in your report you should include 1) A brief introduction to the system and its modelling. 2) your main results obtained – with justifications of work when necessary- from completing each task as in the lab sheet, and 3) a brief conclusion section that summarises the analysis of the system.

– END OF ASSIGNMENT BRIEFING –