Skip to main content
wording change
Source Link
Sterling
  • 553
  • 2
  • 9

Background

Let's say I have a system of equations (e.g. thermodynamics equations), where the "knowns" and "unknowns" are not setsubject to change, and the system of equations can also change based on e.g. the type of thermodynamic process (isothermal, isobaric, isochoric, adiabatic).

Knowns and Unknowns Subject to Change

Take $PV=nRT$. Case 1: If I know $P$, $V$, $n$, and $R$, then $T\rightarrow\frac{PV}{nR}$. Case 2: I know $V$, $T$, $n$, $R$, then $P\rightarrow\frac{nRT}{V}$.

The "Hard-Coded" Solution

An easy solution is:

eqn = P V = n R T;
soln1 = Solve[eqn, T];
soln2 = Solve[eqn, P];

but this can become overwhelming with many input and output variables and especially if the systems of equations are also subject to change.

Question

How do I make make a general solver that takes a system of equations and whatever inputs are supplied (with units) and outputs the best attempt at a solution based on those inputs?

Some SE examples

I think this kind of approach is applicable to the following examples:

Update

2020-09-19 I finally came across two related SE questions:

Background

Let's say I have a system of equations (e.g. thermodynamics equations), where the "knowns" and "unknowns" are not set, and the system of equations can also change based on e.g. the type of thermodynamic process (isothermal, isobaric, isochoric, adiabatic).

Knowns and Unknowns Subject to Change

Take $PV=nRT$. Case 1: If I know $P$, $V$, $n$, and $R$, then $T\rightarrow\frac{PV}{nR}$. Case 2: I know $V$, $T$, $n$, $R$, then $P\rightarrow\frac{nRT}{V}$.

The "Hard-Coded" Solution

An easy solution is:

eqn = P V = n R T;
soln1 = Solve[eqn, T];
soln2 = Solve[eqn, P];

but this can become overwhelming with many input and output variables and especially if the systems of equations are also subject to change.

Question

How do I make make a general solver that takes a system of equations and whatever inputs are supplied (with units) and outputs the best attempt at a solution based on those inputs?

Some SE examples

I think this kind of approach is applicable to the following examples:

Update

2020-09-19 I finally came across two related SE questions:

Background

Let's say I have a system of equations (e.g. thermodynamics equations), where the "knowns" and "unknowns" are subject to change, and the system of equations can also change based on e.g. the type of thermodynamic process (isothermal, isobaric, isochoric, adiabatic).

Knowns and Unknowns Subject to Change

Take $PV=nRT$. Case 1: If I know $P$, $V$, $n$, and $R$, then $T\rightarrow\frac{PV}{nR}$. Case 2: I know $V$, $T$, $n$, $R$, then $P\rightarrow\frac{nRT}{V}$.

The "Hard-Coded" Solution

An easy solution is:

eqn = P V = n R T;
soln1 = Solve[eqn, T];
soln2 = Solve[eqn, P];

but this can become overwhelming with many input and output variables and especially if the systems of equations are also subject to change.

Question

How do I make make a general solver that takes a system of equations and whatever inputs are supplied (with units) and outputs the best attempt at a solution based on those inputs?

Some SE examples

I think this kind of approach is applicable to the following examples:

Update

2020-09-19 I finally came across two related SE questions:

updated background
Source Link
Sterling
  • 553
  • 2
  • 9

Background

This is one of those self-answer questions, and I'm happy to see other answers or comments. Let's say I have a system of equations (e.g. thermodynamics equations), where the "knowns" and "unknowns" are not set, and the system of equations can also change based on e.g. the type of thermodynamic process (isothermal, isobaric, isochoric, adiabatic).

Knowns and Unknowns Subject to Change

Take $PV=nRT$. Case 1: If I know $P$, $V$, $n$, and $R$, then $T\rightarrow\frac{PV}{nR}$. Case 2: I know $V$, $T$, $n$, $R$, then $P\rightarrow\frac{nRT}{V}$.

The "Hard-Coded" Solution

An easy solution is:

eqn = P V = n R T;
soln1 = Solve[eqn, T];
soln2 = Solve[eqn, P];

but this can become overwhelming with many input and output variables and especially if the systems of equations are also subject to change.

Question

How do I make make a general solver that takes a system of equations and whatever inputs are supplied (with units) and outputs the best attempt at a solution based on those inputs?

Some SE examples

I think this kind of approach is applicable to the following examples:

Update

2020-09-19 I finally came across two related SE questions:

Background

This is one of those self-answer questions, and I'm happy to see other answers or comments. Let's say I have a system of equations (e.g. thermodynamics equations), where the "knowns" and "unknowns" are not set, and the system of equations can also change based on e.g. the type of thermodynamic process (isothermal, isobaric, isochoric, adiabatic).

Knowns and Unknowns Subject to Change

Take $PV=nRT$. Case 1: If I know $P$, $V$, $n$, and $R$, then $T\rightarrow\frac{PV}{nR}$. Case 2: I know $V$, $T$, $n$, $R$, then $P\rightarrow\frac{nRT}{V}$.

The "Hard-Coded" Solution

An easy solution is:

eqn = P V = n R T;
soln1 = Solve[eqn, T];
soln2 = Solve[eqn, P];

but this can become overwhelming with many input and output variables and especially if the systems of equations are also subject to change.

Question

How do I make make a general solver that takes a system of equations and whatever inputs are supplied (with units) and outputs the best attempt at a solution based on those inputs?

Some SE examples

I think this kind of approach is applicable to the following examples:

Update

2020-09-19 I finally came across two related SE questions:

Background

Let's say I have a system of equations (e.g. thermodynamics equations), where the "knowns" and "unknowns" are not set, and the system of equations can also change based on e.g. the type of thermodynamic process (isothermal, isobaric, isochoric, adiabatic).

Knowns and Unknowns Subject to Change

Take $PV=nRT$. Case 1: If I know $P$, $V$, $n$, and $R$, then $T\rightarrow\frac{PV}{nR}$. Case 2: I know $V$, $T$, $n$, $R$, then $P\rightarrow\frac{nRT}{V}$.

The "Hard-Coded" Solution

An easy solution is:

eqn = P V = n R T;
soln1 = Solve[eqn, T];
soln2 = Solve[eqn, P];

but this can become overwhelming with many input and output variables and especially if the systems of equations are also subject to change.

Question

How do I make make a general solver that takes a system of equations and whatever inputs are supplied (with units) and outputs the best attempt at a solution based on those inputs?

Some SE examples

I think this kind of approach is applicable to the following examples:

Update

2020-09-19 I finally came across two related SE questions:

added units tag
Source Link
Sterling
  • 553
  • 2
  • 9

Background

This is one of those self-answer questions, and I'm happy to see other answers or comments. Let's say I have a system of equations (e.g. thermodynamics equations), where the "knowns" and "unknowns" are not set, and the system of equations can also change based on e.g. the type of thermodynamic process (isothermal, isobaric, isochoric, adiabatic).

Knowns and Unknowns Subject to Change

Take $PV=nRT$. Case 1: If I know $P$, $V$, $n$, and $R$, then $T\rightarrow\frac{PV}{nR}$. Case 2: I know $V$, $T$, $n$, $R$, then $P\rightarrow\frac{nRT}{V}$.

The "Hard-Coded" Solution

An easy solution is:

eqn = P V = n R T;
soln1 = Solve[eqn, T];
soln2 = Solve[eqn, P];

but this can become overwhelming with many input and output variables and especially if the systems of equations are also subject to change.

Question

How do I make make a general solver that takes a system of equations and whatever inputs are supplied (with units) and outputs the best attempt at a solution based on those inputs?

Some SE examples

I think this kind of approach is applicable to the following examples: Work done in Isobaric Process
Answer to Comparison between isobaric, isothermal and adiabatic expansion
Finding the Enthalpy of an Ideal Gas given internal energy
Adiabatic proccess and Carnot cycle in a photon gas

Update

2020-09-19 A simple thermodynamic questionI finally came across two related SE questions:

Background

This is one of those self-answer questions, and I'm happy to see other answers or comments. Let's say I have a system of equations (e.g. thermodynamics equations), where the "knowns" and "unknowns" are not set, and the system of equations can also change based on e.g. the type of thermodynamic process (isothermal, isobaric, isochoric, adiabatic).

Knowns and Unknowns Subject to Change

Take $PV=nRT$. Case 1: If I know $P$, $V$, $n$, and $R$, then $T\rightarrow\frac{PV}{nR}$. Case 2: I know $V$, $T$, $n$, $R$, then $P\rightarrow\frac{nRT}{V}$.

The "Hard-Coded" Solution

An easy solution is:

eqn = P V = n R T;
soln1 = Solve[eqn, T];
soln2 = Solve[eqn, P];

but this can become overwhelming with many input and output variables and especially if the systems of equations are also subject to change.

Question

How do I make make a general solver that takes a system of equations and whatever inputs are supplied (with units) and outputs the best attempt at a solution based on those inputs?

Some SE examples

I think this kind of approach is applicable to the following examples: Work done in Isobaric Process
Answer to Comparison between isobaric, isothermal and adiabatic expansion
Finding the Enthalpy of an Ideal Gas given internal energy
Adiabatic proccess and Carnot cycle in a photon gas
A simple thermodynamic question

Background

This is one of those self-answer questions, and I'm happy to see other answers or comments. Let's say I have a system of equations (e.g. thermodynamics equations), where the "knowns" and "unknowns" are not set, and the system of equations can also change based on e.g. the type of thermodynamic process (isothermal, isobaric, isochoric, adiabatic).

Knowns and Unknowns Subject to Change

Take $PV=nRT$. Case 1: If I know $P$, $V$, $n$, and $R$, then $T\rightarrow\frac{PV}{nR}$. Case 2: I know $V$, $T$, $n$, $R$, then $P\rightarrow\frac{nRT}{V}$.

The "Hard-Coded" Solution

An easy solution is:

eqn = P V = n R T;
soln1 = Solve[eqn, T];
soln2 = Solve[eqn, P];

but this can become overwhelming with many input and output variables and especially if the systems of equations are also subject to change.

Question

How do I make make a general solver that takes a system of equations and whatever inputs are supplied (with units) and outputs the best attempt at a solution based on those inputs?

Some SE examples

I think this kind of approach is applicable to the following examples:

Update

2020-09-19 I finally came across two related SE questions:

formatting
Source Link
Sterling
  • 553
  • 2
  • 9
Loading
added references
Source Link
Sterling
  • 553
  • 2
  • 9
Loading
added chemistry tag
Link
Sterling
  • 553
  • 2
  • 9
Loading
edited tags
Link
Loading
Source Link
Sterling
  • 553
  • 2
  • 9
Loading