Hi Jose,
Am Montag, den 02.08.2010, 08:09 +0200 schrieb Jose Guzman:
> I am trying to solve at which x-values the function takes a given y
> value. In its most simplistic case, this is easy to get with Solve:
>
> sage: var('t')
> sage: y=1-e**(-t/5)
> sage: sol = solve(y==0.632,t)
> sage: n(sol[0].rhs())
>
>
>
> Which gives me 4.9983, the value I was looking for is 5, so it is OK.
> However, in more complicated expressions (a biexponential of the from:
>
> sage: y=-17.6666666666666*(e^(-1/5*t) - 1)*e^(-3.33333333333333*t
> +0.971148468732930)
>
>
> which varies between 0 an 1 in the interval between x=0 and x=5, the
> task becomes complicated:
> Trying to get the value at which the functions is 20% of its maximum I get
>
> sage: solve(y==.2,t)
> sage: [e^(1/5*t) == 265*e^(-10/3*t + 3467/3570)/(265*e^(-10/3*t +
> 3467/3570) - 3)]
>
> which is indeed another equation which depends on t?
sage didn't find a better algebraic solution. Try to find solutions
numerically.
sage: plot(y, (t,0,5))
shows that y==0.2 will have one solution in [0,0.5] and another solution
in [1,1.5]. You'll get them numerically with
sage: t1 = find_root(y==0.2, 0,0.5); t1
0.023210775112474515
sage: t2 = find_root(y==0.2, 1,1.5); t2
1.1642130321591619
Verify the result:
sage: y.subs(t=t1)
0.200000000000621
sage: y.subs(t=t2)
0.200000000000000
Regards,
Eckhard
--
Service für Mathematik und Simulation
Dr. Eckhard Kosin, selbständiger Diplom-Mathematiker
Am Nymphenbad 14
D-81245 München, Germany
Tel.: (+49)(+89) 88 88 479
Tel.,Fax: (+49)(+89) 835 844
mailto:[email protected]
http://www.mathematik-service-kosin.de
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org