Question
Introduction This project involves the development of a MATLAB-based, menu-driven application to aid in the modeling and curve fitting of data. Project Scenario and Use
Introduction
This project involves the development of a MATLAB-based, menu-driven application to aid in the modeling and curve fitting of data.
Project Scenario and Use of the Application
Data modeling and curve fitting are important across all disciplines of engineering and science. Discovering the form of equation that best fits a set of experimental data may allow numerical predictions of performance and eliminate costly and destructive testing. The best-fit form of a curve also lends insights into the underlying physics of certain processes.
In anticipation that you will someday be an upper level engineering student, you will write this MATLAB- based application to be available to aid you in your future classwork and research.
The scenario is simple: a set of (x,y) data is available in the form of a simple text file the first column represents x-values and the second column represents y-values. The task is to provide the best model (or curve fit) to this set of data. Your application should provide the means to fit the following curve types to the data:
Linear (first order polynomial)
General polynomial of degree n
Exponential
Power Law
Trigonometric
In addition, for each curve fit performed, your application should provide the Mean Square Error (MSE) between the raw data and the fitted curve.
If the user knows that the underlying physics dictates a quadratic fit, for example, then the user can perform that fit and move on. However, if the form of the best fit cannot be anticipated, then the user may try several fits and monitor the value of MSE to help select the overall best fit to the data.
General Features
? The application should be menu driven. o Faculty will post MATLAB files demonstrating a simple text-based menu. o Faculty will do our best to find class time to demonstrate the text-based menu.
? Input will consist of a text file with two columns of numerical values. The columns, together, represent an unknown number of (x,y) pairs. (Number of rows may vary; your program must gracefully handle any length.)
? The program should direct all output and results to both the screen and a report or log file.o Report filename should be chosen by user. o The input data file name should be written to the report file along with date, user name,
etc. o For every curve fit attempted, a record in the log file should indicate the type of curve,
the resulting coefficients and the MSE value. ? All labeled plots should be saved to PDF files as part of the overall report.
Menu Choices
The following are just suggestions. You may choose a different scheme. You may even want to include sub-menus.
? Set/change user name
? Load data file
? Clear data from memory
? Set/change the report filename
? Linear (first order polynomial) fit
? General polynomial of degree n fit
? Exponential fit
? Power Law fit
? Trigonometric fit
? Exit
Error Conditions
It is important for a computer application to give the user guidance with regard to errors and to exit gracefully should errors occur. The following is a list of possible error conditions that your code should check.
? Error/Warning Conditions (Examples) o Trying to load another file when data is in memoryo Input file does not exist. o Report file already exists; data will be overwritten.o Input file has fewer x-values than y-values.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started