Question: Subject: Computer Programming Q 1 : According to a dietician, a person should consume exactly 2 0 0 gm of carbohydrates, at least 1 7
Subject: Computer Programming
Q : According to a dietician, a person should consume exactly gm of carbohydrates, at
least gm of proteins and at most gm of fats in a meal. The dietician also recommends
to have as much amount of vitamins as possible. The three food items that the person eats has
and gm of carbohydrates per kilogram of food item. The same food items contain
gm of proteins in each kilogram. Per kilogram of the same food items comprise of
and gm of fats. Vitamins contained in per kilogram of the same food items are
and gm
Determine how much kilogram of each food item the person should consume so as to have
maximum intake of vitamins by using appropriate builtin function present in MATLAB.
Q : The following data is obtained from an experiment aimed at measuring the spring constant
of a given spring. Different masses m are hung from the spring and the corresponding
deflections of the spring from its upstretched configuration are measured. From physics, we
know that and here Thus, we can find k from the relationship Here,
however, we are going to find k by plotting the experimental data, fitting the best straight line
through the data, and then measuring the slope of the bestfit line.
Write the MATLAB script that shows the steps involved in making a straight line fit through
the given data in the spring experiment and finding the spring constant.
Hint: use the polyfit and polyval function
Q : Question:
In a coalfired power plant, operating on Carnot Cycle, it is possible to set any value for the
temperature of boiler in which heat is added to water at high temperature and any value
for the temperature of condenser in which heat is rejected from steam at low temperature
from the following temperature list
Being an operator of power plant you have to select and from the above temperature list
so that power plant operates at its highest efficiency.
Write a generalized MATLAB program to select two temperature values and for above
condition, without using min and max builtin function.
Print the maximum efficiency of cycle and the temperatures at which it occurs.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
