Search for question
Question

Problem 1- Gradient The Cartesian gradient operator is defined as a a vf = (x ªx + ªy + ₂ª₂)ƒ = xfax +ƒây +₂fa₂ əz and may be thought of as

a "spatial slope" or "direction of steepest increase". To demonstrate the gradient operator, let us consider a 3D temperature field given by the function T(Robs)[°C] = 40R₂ e-R-R3-R² + 100.0 where Robs = Rxây + R,â, + R₂â₂ The gradient of this field is trivial to derive and is VT = (40(1-2R²)e-R³-R3-R² -80 R₂ R, e-R³-R3-R2 -80 R₂ R₂ e--R3-R²) 1. Produce a 3D scatter plot with Matlab (or Python if preferred) which samples the temperature at each point in a l x mx n grid. Display the temperature by setting the color of each scatter point. 2. In the same plot, overlay a set of arrows which represent the gradient of the temperature field. Suggestions: Visibility of the scalar field is dramatically improved by varying the size of each scatter point based on the magnitude of the temperature. Since we are really only interested in the high and low temperature regions, these should have larger scatter points, and the points with an average temperature should have small dots. The scatter3() function in Matlab makes this very easy. Visibility of the scalar field is dramatically improved by setting each scatter point to be slightly transparent (so you can see the points behind the ones in the front). The scatter3() function in Matlab returns an object which you can set to a variable: s = scatter3(); The transparency can be set with the following property: s.MarkerFaceAlpha = 0.7; where 1.0 produces opaque points, and 0.0 produces completely transparent points. Visibility of the gradient vector field is dramatically improved by sampling it at fewer points than the scalar field. This makes each arrow larger and puts more space between arrows. Try using the coneplot() function./nWhat To Turn In: For each problem you must turn in a Zip (.zip) file named with the following format: ELEC3133_P01_operatorName_lastName_firstName.zip This zip folder should contain the following files: 1. All Matlab files (.m) that you wrote. None of these problems will require more than one file. Each Matlab file must have the following header: % ELEC 3133 - Electromagnetic Fields % University of Colorado Denver % Instructor: Mark Travers % Fall 2022 % Programming Project 1 - Gradient % Due: 8/30/22 % Author: Mark Travers Substitute your name in place of mine. 2. All Matlab plots (fig) that you produced. Picture files (.png, .bmp, .jpg, etc.) will not be accepted. 3. Report (.pdf or .docx only) Report The written report should have the following outline: 1. Problem Summary Rewrite the problem statement in your own words. If possible, draw a sketch that illustrates your verbal explanation. 2. Sketch and Verbal Description of Matlab Plot Sketch what you expect your Matlab plot to look like. You may modify your sketch to match your actual Matlab plot if it is different than what you had expected. This section allows you to get partial credit for understanding even if your Matlab code does not work. 3. Matlab plot and Matlab code Put in a screenshot of the Matlab plot you produced and explain what is happening in the plot. Copy and paste your Matlab code which produced this plot into the report. Be sure to "Paste with source formatting" in Microsoft Word to keep the Matlab font and color. Rubric Project files submitted in the way described in "What To Turn In" Matlab code well-commented Matlab code works and produces correct plot Quality of report Extra credit 10% 10% 30% 50%

Fig: 1

Fig: 2