Solving Mathcad Programming Homework with Subroutines

In summary, the conversation discusses a homework question involving solving a formula using subroutines programming without using built-in mathcad functions for operations. The person is having difficulty with the programming and is seeking help on how to approach it. They also mention having trouble with a specific part of the formula and provide their attempt at a solution.
  • #1
tigert2004
9
0

Homework Statement



The actual question is [D]=a[A]-b[C]^T[C]
Solve using subroutines programming, you can use built in mathcad functions to determine the size but you are not supposed to use it for the operations

Homework Equations



(I understand how to do it if we are aloud to use the operations buttons, but I am having problems with the programming) If some is able to explain how to do one of the small subroutines then maybe I will be able to do the rest.

The Attempt at a Solution


I attached my try
 

Attachments

  • Mathcad document.doc
    28 KB · Views: 220
Last edited:
Physics news on Phys.org
  • #2
at the solution, but I am having problems with it. In particular, I don't know how to do D=A*B-b*(C^T*C) and I can't seem to fix it.
 
  • #3
for the subroutine.

I would like to offer some guidance and suggestions on how to approach solving this Mathcad programming homework with subroutines.

Firstly, it is important to understand the concept of subroutines and how they can be used to simplify and organize complex tasks in programming. Subroutines are essentially smaller, self-contained programs that can be called upon to perform a specific task within a larger program. In this case, the task at hand is to solve the given equation using subroutines.

To get started, you will need to break down the given equation into smaller, manageable steps. This will help you identify the different subroutines that you will need to create. For example, you could create a subroutine to calculate the product of two matrices, another one to calculate the transpose of a matrix, and so on.

Next, you will need to write the code for each subroutine, making sure to test and debug them as you go along. It may be helpful to refer to built-in Mathcad functions for guidance on how to perform certain operations, but remember that you are not allowed to use them in your final code.

In your attempt at a solution, I can see that you have created a subroutine called "MatrixProduct" which takes in two matrices as inputs and multiplies them together. This is a good start, but you will need to expand on this and create more subroutines to solve the entire equation.

Some suggestions for additional subroutines could be:

- A subroutine to calculate the transpose of a matrix
- A subroutine to multiply a scalar value to a matrix
- A subroutine to subtract two matrices
- A subroutine to calculate the inverse of a matrix

Once you have all the necessary subroutines, you can then call them within a main program to solve the given equation. This main program could look something like this:

1. Define the matrices A, B, and C
2. Call the subroutines to calculate the transpose of C and the product of A and B
3. Multiply the result of the product with a scalar value
4. Subtract the result from the product of C transpose and C
5. Print the final result

I hope this helps guide you in the right direction for solving your Mathcad programming homework with subroutines. Remember to break down the problem into smaller steps, test and debug your code, and consult with your instructor or classmates if you need further
 

1. What is Mathcad programming?

Mathcad programming is a computational software program used by scientists, engineers, and mathematicians to perform mathematical calculations, analyze data, and create graphs and charts. It allows users to enter equations and expressions using familiar mathematical notation, and then solves them using built-in algorithms.

2. What are the benefits of using Mathcad programming?

There are several benefits to using Mathcad programming, including its user-friendly interface, ability to handle complex mathematical operations, and support for a wide range of mathematical functions and tools. It also allows for documentation and annotation of calculations, making it easier to track and understand the process.

3. Can Mathcad programming be used for data analysis?

Yes, Mathcad programming is commonly used for data analysis. It has built-in statistical functions and tools that can be used to analyze data sets, perform regression analysis, and create charts and graphs to visualize the data. It is especially useful for engineers and scientists who need to analyze large amounts of data in their research.

4. Is Mathcad programming suitable for both beginners and advanced users?

Yes, Mathcad programming can be used by both beginners and advanced users. Its intuitive interface and use of mathematical notation make it easy for beginners to learn and use, while its advanced features and ability to handle complex operations make it a valuable tool for experienced users.

5. Can Mathcad programming be integrated with other software programs?

Yes, Mathcad programming can be integrated with other software programs, such as Microsoft Excel and MATLAB. This allows for seamless data transfer and use of data from different sources, making it a versatile tool for scientific and engineering applications.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
4
Views
3K
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
2
Replies
59
Views
9K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
931
  • STEM Academic Advising
Replies
2
Views
676
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
984
  • Programming and Computer Science
Replies
4
Views
499
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
Back
Top