How to display symbolic function as written/coded
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello, I am trying to symbolicly represent an equation used for a Davidenko numerical analysis method as described by (8). 

Fairly new to using symbolic math with MATLAB so bare with me please. When I try to declare and display the above equation symbolicly and display the results with the following code:
syms n k cn Te ds cs ws %Defining symbolic representation optical parameters (refractive index "n", and exinction coefficient "k"
T10 = ( (4.*cn)./((cn + 1).^2) ); %Fresnel Transmission coefficient between sample and air
WP = ( exp(1j.*(cn - 1).*(ws*ds/cs)) ); %Wave propagation function through sample with thickness "d" in frequency domain "w"
denom = ( 1 - ( exp(2j.*cn.*(ws*ds/cs)).*((cn - 1)./(cn + 1)).^2 ) ); %Fabry-Perot reflection within sample
num = T10*WP;
f = Te - ( (num)/(denom) ); %This is f(w,cn) with constants "ds", "cs" (speed of light)
disp('Symbolic representation of equ(8) from Fastampa');
disp(f); %To test if equation rouglhy looks like that of literature
The result outputed what I interpret as equation (8) but with a common denominator for everything to the right of Texp(w):

I would like my symbolic equation output to not be "expanded" (i.e., have a common denominator) as it makes things easier to follow later on when I manipulate the equation further to take the derivative with respect to cn.
Is there a function or argument I am missing to ensure MATLAB does not change the symbolic equation as I have declared it?
I appreciate any insight :)
3 commentaires
Walter Roberson
le 5 Août 2022
The internal symbolic engine has ways of preventing operations from being carried out. Unfortunately, if you return that version of an expression to the MATLAB level, then MATLAB will reset the symbolic engine if you ask to display that version.
Réponses (0)
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
