[LON-CAPA-users] Algebra Expression Rendering in LON-CAPA

Harding, Gene L glhardin at purdue.edu
Fri Jan 13 17:14:03 EST 2017


Hi Gerd, et al,



Sorry, but it is still not working. Now nothing is rendered at all, and I get this error:

[cid:image001.png at 01D26DBF.D0AE4A30]



This is the function definition:

$function = "$numer/$denom  [pi + \\sum_{n=1}^{\infty}($sum_numer/($sum_denom_n_coeff n - $sum_denom_const))*sin($w nt)]";



This is the call from the xml to render it:

<center> <algebra>$function</algebra></center>



I think the <algebra> call is using Maxima, but I am so new to this that I am not positive.



I noticed something interesting when I compared the int and sum functionality. When I use “int” in the $function definition it needs no backslash at all, but does render the integral sign and arguments. “sum” on the other hand does not work either by itself, with one backslash, or with two backslashes. That makes me wonder if “sum” is the wrong keyword in that context. I don’t know…



Gene L. Harding, PE

Associate Professor of ECET

574-520-4190

Purdue University-South Bend





-----Original Message-----
From: lon-capa-users-bounces at mail.lon-capa.org [mailto:lon-capa-users-bounces at mail.lon-capa.org] On Behalf Of Gerd Kortemeyer
Sent: Friday, January 13, 2017 11:16 AM
To: Discussion list for LON-CAPA users <lon-capa-users at mail.lon-capa.org>
Subject: Re: [LON-CAPA-users] Algebra Expression Rendering in LON-CAPA



Hi,



Ah, okay, it’s inside Perl double quotes! Sorry, I did not catch that. In Perl, “\” is the escape character, so you’ll need “\\” - an escaped backslash.



Apologies, I didn’t make the connection the first time around.



- Gerd.

> On Jan 13, 2017, at 11:05 AM, Harding, Gene L <glhardin at purdue.edu<mailto:glhardin at purdue.edu>> wrote:

>

> Hi,

>

> I think the formatting may be different inside a function assignment. This is what I get when I use the following syntax:

> $function = "$numer/$denom  [pi +

> \sum_{n=1}^{\infty}($sum_numer/($sum_denom_n_coeff n -

> $sum_denom_const))*sin($w nt)]"; <image001.png> Did I mess up the syntax?

>

>

> Gene L. Harding, PE

> Associate Professor of ECET

> 574-520-4190

> Purdue University-South Bend

>

> -----Original Message-----

> From: lon-capa-users-bounces at mail.lon-capa.org<mailto:lon-capa-users-bounces at mail.lon-capa.org>

> [mailto:lon-capa-users-bounces at mail.lon-capa.org] On Behalf Of Gerd

> Kortemeyer

> Sent: Friday, January 13, 2017 10:39 AM

> To: Discussion list for LON-CAPA users

> <lon-capa-users at mail.lon-capa.org<mailto:lon-capa-users at mail.lon-capa.org>>

> Subject: Re: [LON-CAPA-users] Algebra Expression Rendering in LON-CAPA

>

> Hi,

>

> It’s \sum

>

> as in

>

> \sum_{n=1}^{\infty}

>

> - Gerd.

>

> > On Jan 13, 2017, at 10:29 AM, Harding, Gene L <glhardin at purdue.edu<mailto:glhardin at purdue.edu>> wrote:

> >

> > Hi,

> >

> > I am having trouble rendering an algebraic expression with a summation sign (capital Sigma). I want an expression that looks like this, using variables for the numeric portions of the expression:

> > <image003.jpg>

> > I am able to render the integration sign using this code:

> > $function = "$numer/$denom  [pi + int($sum_numer/($sum_denom_n_coeff

> > n

> > - $sum_denom_const),1,3)*sin($w nt)]"; …providing an expression that looks like this:

> > <image004.png>

> >

> > But when I try to render the summation sign using this code:

> > $function = "$numer/$denom  [pi + sum($sum_numer/($sum_denom_n_coeff

> > n

> > - $sum_denom_const),n,1,3)*sin($w nt)]"; …I get the following:

> > <image005.png>

> >

> > I have spent a couple of hours looking through the Maxima Manual and other references, as well as some examples I have found online, but have not been able to figure out the syntax for rendering the summation sign. Can anyone offer advice on how to do this?

> >

> > Also, although not so important, if someone can tell me how to replace the outer parentheses with square brackets, and/or how to display the numeric part of the sine argument with commas (e.g., 90,000 vs 90000), I would really appreciate it.

> >

> > Thanks,

> >

> > Gene L. Harding, PE

> > Associate Professor of ECET

> > 574-520-4190

> > Purdue University-South Bend

> >

> > _______________________________________________

> > LON-CAPA-users mailing list

> > LON-CAPA-users at mail.lon-capa.org<mailto:LON-CAPA-users at mail.lon-capa.org>

> > http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

>

> --

> Gerd Kortemeyer, Ph.D.

> Associate Professor of Physics

> Director, LON-CAPA Project

> Michigan State University

> http://www.msu.edu/user/kortemey/

>

>

>

>

> _______________________________________________

> LON-CAPA-users mailing list

> LON-CAPA-users at mail.lon-capa.org<mailto:LON-CAPA-users at mail.lon-capa.org>

> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

> _______________________________________________

> LON-CAPA-users mailing list

> LON-CAPA-users at mail.lon-capa.org<mailto:LON-CAPA-users at mail.lon-capa.org>

> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users



--

Gerd Kortemeyer, Ph.D.

Associate Professor of Physics

Director, LON-CAPA Project

Michigan State University

http://www.msu.edu/user/kortemey/









_______________________________________________

LON-CAPA-users mailing list

LON-CAPA-users at mail.lon-capa.org<mailto:LON-CAPA-users at mail.lon-capa.org>

http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20170113/458c7557/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 6199 bytes
Desc: image001.png
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20170113/458c7557/attachment-0001.png>


More information about the LON-CAPA-users mailing list