Symbolic Package Display

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Symbolic Package Display

Thomas D. Dean-2
I use X and command line octave on Linux.  Seems like the interaction of
the GUI, me, and other applications have difficulties.  I frequently
cut/paste between applications in multiple xterms.  Anyway, I prefer the
command line.

The output of the symbolic package is not useful.

 From a previous post:

===============================================
octave:478> [x1 y2]=solve(eq1,eq2,x,y)
x1 = (sym)

   2â
b
   âââ
    a

octave:488> x1
x1 = (sym)

   2â
b
   âââ
    a

octave:489> x1.ascii
ans = 2*b
---
  a
octave:490> disp(x1)
   2â
b
   âââ
    a
octave:491> y2.ascii
ans = 3*b

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

Is there some setting that will change this?

Tom Dean

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Symbolic Package Display

Mike Miller-4
On Sat, May 06, 2017 at 09:29:20 -0700, Thomas D. Dean wrote:
> I use X and command line octave on Linux.  Seems like the interaction of the
> GUI, me, and other applications have difficulties.  I frequently cut/paste
> between applications in multiple xterms.  Anyway, I prefer the command line.
>
> The output of the symbolic package is not useful.
[…]
> Is there some setting that will change this?

It looks like your terminal emulator doesn't support UTF-8 or is set to
assume a different character encoding. If you use a terminal emulator
that handles UTF-8 correctly, it should look right.

Or you can use the sympref command to display symbolic variables
differently.

Try either `sympref display ascii` or `sympref display flat` if you
don't want the default UTF-8 behavior.

--
mike

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Symbolic Package Display

Thomas D. Dean-2
On 05/06/17 13:30, Mike Miller wrote:

Thanks,

I am using a standard xterm.

Setting utf-8 and utf-8 fonts fixed the display.  Now, how is this
accomplished from the command line when starting an xterm executing octave?

/usr/bin/xterm -j -sk -sb -sl 1000 -fn 9x15 -bc -bg white -fg black
-geometry 80x55 -e octave --no-gui&

Tom Dean

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Symbolic Package Display

Thomas D. Dean-2
On 05/06/17 16:04, Thomas D. Dean wrote:

> On 05/06/17 13:30, Mike Miller wrote:
>
> Thanks,
>
> I am using a standard xterm.
>
> Setting utf-8 and utf-8 fonts fixed the display.  Now, how is this
> accomplished from the command line when starting an xterm executing octave?
>
> /usr/bin/xterm -j -sk -sb -sl 1000 -fn 9x15 -bc -bg white -fg black
> -geometry 80x55 -e octave --no-gui&
>

-en UTF-8


/usr/bin/xterm -en UTF-8 -j -sk -sb -sl 1000 -fn 9x15 -bc -bg white -fg
black -geometry 80x55 -e octave --no-gui&

Tom Dean

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Symbolic Bug 45423, is there a workaround

Thomas D. Dean-2
In reply to this post by Thomas D. Dean-2
SymString = "syms s R1 C1 R2 C2 R3 R4 I_V1 V1 v_1 v_2 v_3 v_4"
eval(SymString);


## this produces an error.  An open bug report exists.
Astring = "A=[ 0+1/R1 0-1/R1 0 0 1; 0-1/R1 0+1/R1+s*C1+1/R2 0-1/R2 0 0;
0 0-1/R2 0+1/R2+s*C2+1/R3 0-1/R3 0; 0 0 0-1/R3 0+1/R3+1/R4 0; 1 0 0 0 0;]";
eval(Astring)

## this does not produce the error
Astring = "A=[ 0+1/R1 0-1/R1 0 0 1; 0-1/R1 0+1/R1+s*C1+1/R2 0-1/R2 0 0;
sym(0) 0-1/R2 0+1/R2+s*C2+1/R3 0-1/R3 0; sym(0) 0 0-1/R3 0+1/R3+1/R4 0;
sym(1) 0 0 0 0;]";
eval(Astring)

This is in the middle of a complex matlab script, scam.m.

Is there an easy workaround?

Tom Dean

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Symbolic Bug 45423, is there a workaround

Mike Miller-4
On Mon, May 08, 2017 at 15:39:45 -0700, Thomas D. Dean wrote:

> SymString = "syms s R1 C1 R2 C2 R3 R4 I_V1 V1 v_1 v_2 v_3 v_4"
> eval(SymString);
>
>
> ## this produces an error.  An open bug report exists.
> Astring = "A=[ 0+1/R1 0-1/R1 0 0 1; 0-1/R1 0+1/R1+s*C1+1/R2 0-1/R2 0 0; 0
> 0-1/R2 0+1/R2+s*C2+1/R3 0-1/R3 0; 0 0 0-1/R3 0+1/R3+1/R4 0; 1 0 0 0 0;]";
> eval(Astring)
>
> ## this does not produce the error
> Astring = "A=[ 0+1/R1 0-1/R1 0 0 1; 0-1/R1 0+1/R1+s*C1+1/R2 0-1/R2 0 0;
> sym(0) 0-1/R2 0+1/R2+s*C2+1/R3 0-1/R3 0; sym(0) 0 0-1/R3 0+1/R3+1/R4 0;
> sym(1) 0 0 0 0;]";
> eval(Astring)
>
> This is in the middle of a complex matlab script, scam.m.
>
> Is there an easy workaround?

What you have is an easy workaround.

A slightly easier workaround is to put square brackets around the rows
that don't contain syms. This is mentioned at
https://github.com/cbm755/octsympy/issues/8.

For your example that looks like

Astring = "A=[ 0+1/R1 0-1/R1 0 0 1; 0-1/R1 0+1/R1+s*C1+1/R2 0-1/R2 0 0; 0 0-1/R2 0+1/R2+s*C2+1/R3 0-1/R3 0; 0 0 0-1/R3 0+1/R3+1/R4 0; [1 0 0 0 0];]";

--
mike

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Symbolic Bug 45423, is there a workaround

Colin Macdonald-2
In reply to this post by Thomas D. Dean-2
On 08/05/17 03:39 PM, Thomas D. Dean wrote:
> ## this does not produce the error
> Astring = "A=[ 0+1/R1 0-1/R1 0 0 1; 0-1/R1 0+1/R1+s*C1+1/R2 0-1/R2 0 0;
> sym(0) 0-1/R2 0+1/R2+s*C2+1/R3 0-1/R3 0; sym(0) 0 0-1/R3 0+1/R3+1/R4 0;
> sym(1) 0 0 0 0;]";
> eval(Astring)
>
> Is there an easy workaround?

You've already found the workaround I'm afraid :(

Colin

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave