MATLAB question:


TASK 4:
Programming code in MATLAB;
clc;
clear all;
close all;
function [t, v] = VPiecewise(start_t, end_t)
////////////// Creates two vectors v and t
//////////// Creating vector t at increments of 0.01
t = start_t:0.01:end_t;
///////////// Initializing vector v
v = [];
/////////// Using loop to find v values
for i=1:length(t)
///////// Finding profile conditions
if t(i)>=0 && t(i)<=10
//////////// Updaitng vector
v = [v ((11*t(i)*t(i)) - (5*t(i)))];
elseif t(i)>10 && t(i)<=20
///////////// Updaitng vector
v = [v (1100 - (5*t(i)))];
elseif t(i)>20 && t(i)<=30
////////////////// Updaitng vector
v = [v ((50*t(i)) + ( 2 * ( (t(i)-20) ^ (2.5) )))];
elseif t(i)>30
/////////////// Updaitng vector
v = [v ((1520) * ( exp((-0.1)*(t(i)-30)) ))];
else
v = [v 0];
end % If end
end % For loop end
end % Function end
Script:
//////////// Plotting travel of a real world objects in a jagged
manner
[t, v] = VPiecewise(-5, 80);
///////////// Plotting graph
plot(t, v);
title("Travel of a real world objects in a jagged manner");
xlabel("t");
ylabel("v");
MATLAB O/P:
TASK 5):
MATLAB CODE:
clc;
clear all;
close all;
%%%%%%%%%% the threshold value
Trshold = input('Please enter the error threshold:')
xvl = linspace(-2*pi,2*pi);
cos_trm = ones(size(xvl));
cos_appx = cos_trm;
nvl = 2;
xsqrd = xvl.^2*nvl;
%%%%%%%% Calculation of the approximation
while abs(cos_trm(end)) > Trshold
cos_trm = - cos_trm.*xsqrd./factorial(nvl);
cos_appx = cos_appx + cos_trm;
nvl = nvl + 2;
end
%%%%%%%%%% Calculate truncate error
trun_err = abs(cos_appx - cos(xvl));
fprintf('N value: %d \n',nvl);
fprintf('Mean truncation error: %0.6f \n',mean(trun_err));
fprintf('The error is: %0.6f \n', trun_err);
%%%%%%%%%%%% Perform the plot
plot(xvl,trun_err)
MATLAB O/P:

Task 4 Many real world objects travel in a jagged manner that is best represented by piecewise fu...
How to do question B
2,3,4,5?
3. a) Find the solution v ote ordinary diferetinl equation with the initial coditions: b) i) Recast our third ord ODE into a system af first order ODEs af the formA.v, where v' = dv/dz f(v) and v = (y, y,y")". You should show all working to find the corresponding matrix A. Do not solve the system. 4 mark Solve it only by hand and show your complete work. Do not use a calculator...
Task The task for this assignment is to have the following user-defined data type: struct rgb { unsigned char red; unsigned char green; unsigned char blue; }; be able to be: read in from a stream (e.g., std::cin), i.e., write: std::istream& operator >>(std::istream& is, rgb& colour); (see below) written out to a stream (e.g., std::cout), i.e., write: std::ostream& operator <<(std::ostream& os, rgb const& colour); (see below) stored in a container, e.g., std::vector<rgb>, std::array<rgb,16>; (see below) processed via algorithms (and other...
the code in the photo for this I.V.P
dy/dx= x+y. y(0)=1
i need the two in the photo
thank you
New folder Bookmarks G Google dy/dx x+y, y(0)=1 2 h Exact Solution 1.8 Approximate Solution Mesh Points 1.6 -Direction Fied 1.4 1.2 1 0.8 04 0.2 0.3 0.1 0 X CAUsersleskandara\Desktop\New folder emo.m EDITOR PUBLISH VEW Run Section FILE NAVIGATE EDIT Breakpoints Run Run and FL Advance Run and Advance Time BREAKPOINTS RUN 1 - clear all 2 clc 3-...
i need help with a mips program to to covert roman numerals to
real numbers
Lab 4: Roman Numeral Conversion Part A: Due Sunday, 19 May 2019, 11:59 PM Due Friday, 24 May 2019, 11:59 PM Part B: Minimum Submission Requirements Ensure that your Lab4 folder contains the following files (note the capitalization convention): o Diagram.pdf o Lab4. asm O README.txt Commit and push your repository Lab Objective In this lab, you will develop a more detailed understanding of how...
10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated sludge operation that adversely affect effluent quality with origins in the engineering, hydraulic and microbiological components of the process. The real "heart" of the activated sludge system is the development and maintenance of a mixed microbial culture (activated sludge) that treats wastewater and which can be managed. One definition of a wastewater treatment plant operator is a "bug farmer", one who controls the aeration...