assume( y, symbol );

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 562
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

assume( y, symbol );

Message par compsystems » jeu. juil. 26, 2018 4:57 pm

Hello, why when executing, it informs that the y variable assumes as symbolic, if in the header already predifined as symbolic.

Code : Tout sélectionner

terminalViewTest():={
        local x, y;
        assume( x, symbol ); 
        assume( y, symbol );
        autosimplify( nop );
        DispG; 
        ClrIO; 
        printf( "Terminal View, 2D printing" );
        
        printf( "" );      
        printf( "Expr0:" );
        printf( (x^3-6*x^2+11*x-6 | x=y) + (x^4-x^3-6*x^2+11*x-6)/x^6);
        
        printf( "" );
        printf( "Expr1:" ); printf( "" ); f(x):=x^3-2*x^2+1*x-1;
        printf( 'f(x)' ); printf( "" );
        printf( f(x) );printf( "" );
        
        printf( "" );
        printf( "Expr2:" ); printf( "" );
        printf( 'f(x) | x=y' ); printf( "" );
        printf( 'x^3-2*x^2+1*x-1 | x=y' ); printf( "" );
        printf( f(x) | x=y ); printf( "" );
        printf( 'f(y)' ); printf( "" );
        printf( f(y) ); printf( "" );
        
        printf( "" );
        printf( "Expr3:" ); g(x):=1/(x+3);
        printf( 'g(x)' ); printf( "" );; 
        printf( g(x) );  printf( "" );
   
        printf( "" );     
        printf( "Expr4:" );
        printf( 'f(g(x))' ); printf( "" ); 
        printf( f(g(x)) ); printf( "" );

        printf( "" );     
        printf( "Expr5:" );        
        printf( 'g(f(x))' ); printf( "" );
        printf( g(f(x)) ); printf( "" );
        
        return "Done";
}:;
terminalViewTest();
// Warning: y, declared as global variable(s). If symbolic variables are required, declare them as local and run purge

parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: assume( y, symbol );

Message par parisse » sam. juil. 28, 2018 5:56 pm

| is implemented using a program, that's probably why you get warnings. Try subst(expression,var,value).

Répondre