solve and calculate

i like this post (click again to cancel)
0
i dont like this post (click again to cancel)

How can I solave an equation like x+z^2=1 and then calculate x with z=3 from the solution?

Thanks.

asked Jan 26 '12

Mebus gravatar image Mebus
5 2

If you think you have made a mistake in your question you can edit your question. Please do not post duplicate.

Shashank (Jan 26 '12)

2 Answers:

i like this answer (click again to cancel)
1
i dont like this answer (click again to cancel) Mebus has selected this answer as correct
z=var('z')
solve(x+z^2==1,x)[0].substitute(z==3)
link

posted Jan 26 '12

Shashank gravatar image Shashank flag of United States
1580 6 22 55

This works, but is there also a more comfortable way to write this:

solve(energiebilanz, h51x)[0].substitute(c_luft=12m/s, mw=(1/3600)kg/s, hw=146.68J/g, TL=313K)

maybe like in a set of parameters?

Thanks.

Mebus (Jan 27 '12)

This works, but is there also a more comfortable way to write this:

solve(energiebilanz, h51x)[0].substitute(c_luft=12m/s, mw=(1/3600)kg/s, hw=146.68J/g, TL=313K)

Mebus (Jan 27 '12)
i like this answer (click again to cancel)
1
i dont like this answer (click again to cancel)

A variation on the Shashank'answer :

sage: z=var('z')
sage: f(z)=solve(x+z^2==1,x)[0].rhs()
sage: f
z |--> -z^2 + 1
sage: f.diff(z)
z |--> -2*z
sage: f.plot()

Here you consider the function "solution of the equation as function of z", and you do whatever with it.

link

posted Jan 27 '12

Laurent Claessens gravatar image Laurent Claessens
354 4 8 20
http://homepages.ulb.ac.b...

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Tags:

Stats:

Asked: Jan 26 '12

Seen: 65 times

Last updated: Jan 27 '12

powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.