Re: [sage-support] Re: Held recursion

2024-08-25 Thread erentar2002
hold( Dt(expression1) )     else:     return sum(map(lambda arg:diff(expression1,arg)*Dt(arg),expression1.args())) ``` Apologies. On 26/08/2024 00:06, erentar2002 wrote: Thank you very much for your reply, i learned a lot My initial intention when asking the prior question was to define

Re: [sage-support] Re: Held recursion

2024-08-25 Thread erentar2002
Thank you very much for your reply, i learned a lot My initial intention when asking the prior question was to define a function where some evaluations would return itself, while other evaluations would not. Such as ``` def f(x):     if x%2==0:     return hold(f(x))     else:     retu

[sage-support] Held recursion

2024-08-25 Thread erentar2002
Greetings, I am trying to return a function call from the function itself with the context `hold` The following example does not behave as i'd want: ``` def g(x):     with hold:     held = sqrt(x)     return held g(4) > 2 ``` To get around this, i make the change SR(x): ``` def g(x):  

[sage-support] plot() silently switches to a different scale when numbers are too big

2022-09-20 Thread erentar2002
My problem can be explained with the following two plots: plot(factorial(x),x,0,9) and plot(factorial(x),x,0,10) When plotting up to 9, the plot gives me exactly what i expect, a linear-linear plot. When plotting up to 10 though, sage silently chose to make the y-axis log10. This should not

[sage-support] (Noob question) solve( sin(x)==.5, x) should return two solutions but only returns one

2022-09-07 Thread erentar2002
Hello! I hope the title was clear enough but here is my problem: ``` sage: var(x); sage: solve( sin(x)==.5, x ) [x == 1/6*pi] ``` I believe this equation should have 2 solutions: `pi/6` and `5pi/6`. What mistake did i do? Thank you -- You received this message because you are subscribed to t

Re: [sage-support] Unexpected result for cos(a)^2 + sin(a)^2, question about variables

2022-04-30 Thread erentar2002
Thank you! On 30/04/2022 09:09, Emmanuel Charpentier wrote: Also : |sage: b.simplify_trig() 1 | Using specific simplifications in a specific order is often the key to get interesting results that the brute-force |simplify_full| cannot. Such simplifications are : |sage: import re sage: pri