kill(all)$

appendix : LCM ( = least common multiplier)
peter.vlasschaert@gmail.com,14/11/2019

input : shift & enter both together.

?? lcm;

load packages
============

load(lrats)$

load(functs)$

  ===========================

lcm(2,5,7,8);

280/5;

result
====
see : website
maxima : enter : read ,solve reaction equation   , version 1.3beta
peter.vlasschaert@gmail.com,07/11/2019
list :

number of products :
================

npb:2;

number of reaction products
======================

npa:2;

list : result
========

l:[x1=%r1,x2=%r1/2,y1=%r1/2,y2=%r1];

How to find elements in a list
======================

p1:l[1];

p2:last(l);

p3:firstn(l,3);

How to find values of the list
=====================

l1a:makelist(lhs(l[i]),i,1,npa+npb);

l1b:makelist(rhs(l[i]),i,1,npa+npb);

 => only denominator (from the values)
==============================

s:npa+npb;

l1b:makelist(denom(l1b[i]),i,1,s);

How to find : LCM 'l1b'
=================

k:lcm(l1b);

find :definition :lcm of a list
====================

definition : lcmlistresult(npb,npa,vv)
------------------------------------------------
vv   =>  [x1=%r1,x2=%r1/2,y1=%r1/2,y2=%r1]
npb => products                 (b = before)
npa => reaction products  (a = after    )

lcmlistresult(npb,npa,vv):=block([],
    s:npb+npa,
    v1:makelist(rhs(vv[i]),i,1,s),
    v2:makelist(denom(v1[i]),i,1,s),
    v3:lcm(v2),
    return(v3))$    
    

v4:lcmlistresult(npb,npa,l);