How do I simplify an equation found using the symbolic solver?

10 views (last 30 days)
The equation involves fractions and logarithmic functions, and no matter how many steps I specify in the simplify command, the log's and fractions are not simplified to their decimal forms. Additionally, numbers are being carried out to as many significant digits as they occupy without any scientific notation.
Is there a way to simplify the equation to solve all fractions and log functions and display everything in scientific notation? My code is below. I am trying to simplify the function h as much as possible.
Thanks in advance for assistance.
close all clear all clc
% Declare variables syms t p R p1 p2 t1 t2
% Define known constants and variables R = 8.314; % units of J/(mol-K) p1 = 2.0*101325; % conversion of atm to Pa (kg/m-s^2) p2 = 0.5*101325; % conversion of atm to Pa (kg/m-s^2) t1 = 1000; % unit of K
% Integrate both terms in entropy equation over full range of % temperature, and from p1 to p2 f = int((1/t)*(-3.74 + 30.5*(t/100)^(1/2) - 4.10*(t/100) + 0.0242*(t/100)^2),t,t1,t2); g = int(R/p,p,p1,p2);
% Set equation to zero because it is an isentropic expansion % ds = 0 h = f - g == 0;
h = simplify(h,'steps',1000)

Answers (1)

Michael Haderlein
Michael Haderlein on 5 Feb 2015
I think there's a misunderstanding: simplify does not solve anything, it just tries to simplify the equation (whatever that exactly means). E.g.
>> simplify((1-cos(x)^2),100)
ans =
sin(x)^2
Btw., simple does the same but tries harder.
You will agree that both fractions and logarithms can only be displayed with round-off errors for the very most numbers. However, as simplify is algebraic, this cannot happen. Maybe vpa is what you are looking for, but there will be round-off errors.
>> vpa('123456789',3)
ans =
1.23e8
  9 Comments

Sign in to comment.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!