Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 13: Functions with multiple return arguments Let's write a function to do Exercise 1. Use the nchoosek function inside your function to make your

Exercise 13: Functions with multiple return arguments

Let's write a function to do Exercise 1. Use the nchoosek function inside your function to

make your code as general as possible.

Write a function

[indreac, r] = ind sets(V)

in which V is a stoichiometric matrix, r is its rank r , and indreac is a matrix containing

the set of all linearly independent reactions, with each row containing a set of r integers

corresponding to a set of reactions that are linearly independent. A function can return

more than one argument, by placing the list of return arguments inside square brackets as

above.

(a) Pass in the stoichiometric matrix from Exercise 1 to check your function. Print out

the returned matrix indreac for this problem.

(b) Find your own favorite chemical reaction set with 7 or more reactions and species

whose rank is at least 2 less than the number of reactions. Apply your function to

this stoichiometric matrix and print out the list of all linearly independent reactions.

Notice that when you have a calculation that you need to repeat many times on dif-

ferent data, it's convenient to write and store a function to perform the calculation.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

Why do people behave unethically?

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago