ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 01 May 2022 00:58:43 +0200How to force the substitution since subs is not working?https://ask.sagemath.org/question/62244/how-to-force-the-substitution-since-subs-is-not-working/I have an expression containing `alpha_1`, `beta_1`, `gamma_1`.
They are normalized by the constraint `alpha_1^2 + beta_1^2 + gamma_1^2 = 1`.
That would simplify the expression. Somehow `subs` doesn't work.
After defining `dkkr1` as
dkkr1 = 2*I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*beta_1/(c^2*gamma_1^2 + (alpha_1^2 + beta_1^2)*c^2 - v2^2) - 2*(-I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*alpha_1^2*c^4 - I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*c^4*gamma_1^2 + (I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*beta_1^2*v1^2 + I*pi*sqrt(-c^2*gamma_1^2 - (alpha_1^2 + beta_1^2)*c^2 + v2^2)*sqrt((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*c^2)*v2^2)*Delta/(c^6*gamma_1^4 + 2*(alpha_1^2 + beta_1^2)*c^6*gamma_1^2 + (alpha_1^4 + 2*alpha_1^2*beta_1^2 + beta_1^4)*c^6 + ((alpha_1^2 + beta_1^2 + gamma_1^2)*v1^2 + c^2)*v2^4 + (c^4*gamma_1^6 + 3*(alpha_1^2 + beta_1^2)*c^4*gamma_1^4 + 3*(alpha_1^4 + 2*alpha_1^2*beta_1^2 + beta_1^4)*c^4*gamma_1^2 + (alpha_1^6 + 3*alpha_1^4*beta_1^2 + 3*alpha_1^2*beta_1^4 + beta_1^6)*c^4)*v1^2 - 2*(c^4*gamma_1^2 + (alpha_1^2 + beta_1^2)*c^4 + (c^2*gamma_1^4 + 2*(alpha_1^2 + beta_1^2)*c^2*gamma_1^2 + (alpha_1^4 + 2*alpha_1^2*beta_1^2 + beta_1^4)*c^2)*v1^2)*v2^2)
I try to substitute
dkkr1= dkkr1.subs(sqrt(1- alpha_1^2 - beta_1^2) == gamma_1)
show(dkkr1)
I am new to SageMath and would love to learn how to make this work.ny2292000Sun, 01 May 2022 00:58:43 +0200https://ask.sagemath.org/question/62244/How can I substitute an unknown function in an expression with a known function?https://ask.sagemath.org/question/60468/how-can-i-substitute-an-unknown-function-in-an-expression-with-a-known-function/I have defined an unknown function "p" with command
p=function("p")
Then I deduced another function, which contains "p":
aws(time)=921600*(-1333.33340000000*time + 2000)/(-3.36000004800000e6*p(time) + 3840000)
Now I would like to plot the function aws(time), by subtituting p(time) with a known function, like:
p(time)=time^0.54
I discovered I can't use .subs() as with free variables, so this doesn't work:
aws.subs(p(time)==time^0.54)
Then how can I substitute the known function, to be able to plot aws(time) finally?
KonstantinTue, 28 Dec 2021 03:11:56 +0100https://ask.sagemath.org/question/60468/