Forums before death by AOL, social media and spammers... "We can't have nice things"
|    sci.math.symbolic    |    Symbolic algebra discussion    |    10,432 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 10,116 of 10,432    |
|    Nasser M. Abbasi to clicliclic@freenet.de    |
|    Re: Julia is the future of RUBI !    |
|    10 Mar 21 12:41:43    |
      From: nma@12000.org              On 3/10/2021 12:35 PM, clicliclic@freenet.de wrote:       >       > "Nasser M. Abbasi" schrieb:       >>       >> On 3/4/2021 4:29 PM, Nasser M. Abbasi wrote:       >>>       >>> Only thing so far I found which I did not like too much, is       >>> when taking derivative of expression Z w.r.t say x, one       >>> has to define the derivative part w.r.t. x, on a separate line,       >>> then apply it on the expression on next line. Like this:       >>>       >>> ============       >>> @variables x y;       >>> D = Differential(x)       >>> ....few line later one can do....       >>> D(y) # Differentiate y wrt. x       >>> ==========       >>>       >>> One can't write on same line       >>>       >>> diff(y(x),x)       >>>       >>> as normally with say Maple or Mathematica, etc... which       >>> for me is more clear since one sees the expression and the       >>> variable x, on same line. May be there is a way around       >>> this.       >>       >> Ok, figured it out       >> ==========================       >> julia> using Symbolics;       >> julia> @variables x y;       >> julia> y=x^2*sin(x);       >> julia> expand_derivatives(Differential(x)(y))       >>       >> cos(x)*(x^2) + 2x*sin(x)       >> ============================       >>       >> So       >> diff(y,x)       >>       >> translates to       >>       >> expand_derivatives(Differential(x)(y))       >>       >                     > This forces one to type 38 instead of 9 characters. I suspect that the       > "expand_derivatives()" can be replaced by some general-purpose command       > like "evaluate()", however.       >       > Does the system distinguish upper from lower case? Would "differential"       > or "Expand_derivatives" thus fail?       >       > Martin.       >              It will fail yes, Julia is Case sensitive.       The reason for expand_derivatives is because Differential       is a "lazy" operator. So this causes it to evaluate.              I agree, it is much more verbose than "diff(y,x)" or "D[y,x]"       but that is the only way I found to have the expression and       the differentiation variable show up on same line.              I am sure one can write a function to wrap all this in,       call it "diff(expression,variable)", to reduce the typing to do each time.              --Nasser              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca