4.0

4.0 | 3 ratings Rate this file 4 Downloads (last 30 days) File Size: 5.93 KB File ID: #9234

oblique shock wave relations

by Nir Kalush

 

04 Dec 2005 (Updated 05 Dec 2005)

Given two of three variables, finds the third variable (Mach num, Beta, Theta) ...

| Watch this File

File Information
Description

My program allows users to choose which variable they want to solve for. USES SYMBOLIC TOOLBOX CREATED IN MATLAB 6.1

they are asked to provide the other two.

this is the Beta-Theta-Mach relation for oblique shock waves.

note: solving for theta will result in a precise answer

while solving for Mach number or Beta relies on numerical approximations.

I output the error in the approximation

Algorithm used: most basic i.e. O(N^2)

Required Products Symbolic Math Toolbox
MATLAB release MATLAB 6.1 (R12.1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
06 Dec 2005 John D'Errico

The author has put some effort into this code. At least it
is a function, not a script. Of course, given that it is a
function, why use input to provide the parameters? This
is why matlab allows the provision of input arguments to
a function. As a function, this code should also return the
value solved for.

It needs better documentation. A line or two that
describes the actual equation being solved would help,
to ensure that a user knows what is being solved. The
user gets very little information when they call help on
this function, and forcing the user to edit the code and
decipher what it does seems silly.

The actual solution is very inefficiently coded, using
brute force loops to creep up on a solution. Fzero would
have been a better solution. Best of course is the fairly
simple algebraic solution that would exist. For example,
the equation appears to be a quadratic polynomial in
Mach number, and transformable to a polynomial roots
problem in beta. While these last comments are purely
that of programming style, the approach chosen will
severely (negatively) impact the efficiency and accuracy of
the result.

I was pleased to see error checks done on the input
parameters.

08 Dec 2005 Author nick

Thank you Mr. D'Errico,

I realize the methodology is probably the worst possible.

At the end of my semester (15 days from date of submission) I plan on rewriting the code and making it more useful.

I Will most definently use your advices and I completely forgot about FZERO. I am not sure how one can write a help file for a function. If you pass by this page again, or somebody else, please do offer more advices.

Sincerely,

Nick

21 Aug 2006 khashayar parsay  
22 Nov 2006 David Billingsley

This is a great little program. Only face lifts would be a clarification of the user interface and function form for use inside of programs.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
aerospace Nir Kalush 22 Oct 2008 08:08:26
aeronautics Nir Kalush 22 Oct 2008 08:08:26
aerodef Nir Kalush 22 Oct 2008 08:08:26
theta Nir Kalush 22 Oct 2008 08:08:26
beta Nir Kalush 22 Oct 2008 08:08:26
mach Nir Kalush 22 Oct 2008 08:08:26
number Nir Kalush 22 Oct 2008 08:08:26
relations Nir Kalush 22 Oct 2008 08:08:26
oblique Nir Kalush 22 Oct 2008 08:08:26

Contact us at files@mathworks.com