how to solve symbolic function with initial values

  • Follow


hi,

i have a symbolic equation and i want to solve with initial values which is x=1.2, y=1.2

syms x y;
u = -x^2 + x - y + 0.75;
v = x^2 - 5*x*y - y;

dux=diff(u,x);
duy=diff(u,y);
dvx=diff(v,x);
dvy=diff(v,y);

xi = x - (u*dvy - v*duy)/((dux*dvy)-(duy*dvx))

how to solve xi = ?   initial values are x=1.2 and y =1.2

or 

simplify(xi)

6/5 - (- 5*x^3 + 3*x^2 + (19*x)/4 + 3/4)/(- 10*x^2 + x + 5*y + 1)
how to solve above equation in x=1.2 and y=1.2

thanks a lot.
0
Reply klutch 12/3/2010 1:45:25 PM


"klutch " <klutch52@gmail.com> wrote in message 
news:idas9l$pmo$1@fred.mathworks.com...
> hi,
>
> i have a symbolic equation and i want to solve with initial values which 
> is x=1.2, y=1.2
>
> syms x y;
> u = -x^2 + x - y + 0.75;
> v = x^2 - 5*x*y - y;
>
> dux=diff(u,x);
> duy=diff(u,y);
> dvx=diff(v,x);
> dvy=diff(v,y);
>
> xi = x - (u*dvy - v*duy)/((dux*dvy)-(duy*dvx))
>
> how to solve xi = ?   initial values are x=1.2 and y =1.2

Your use of DIFF and your use of the term "initial values" makes me think 
you're trying to solve a differential equation (for which DSOLVE would be 
the appropriate tool) but your xi doesn't include any derivative terms, so 
I'm not _really_ sure what you're trying to do.  Please reply and clarify 
your exact goal.

-- 
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlab.wikia.com/wiki/FAQ
To contact Technical Support use the Contact Us link on 
http://www.mathworks.com 

0
Reply Steven_Lord 12/3/2010 2:38:01 PM


> Your use of DIFF and your use of the term "initial values" makes me think 
> you're trying to solve a differential equation (for which DSOLVE would be 
> the appropriate tool) but your xi doesn't include any derivative terms, so 
> I'm not _really_ sure what you're trying to do.  Please reply and clarify 
> your exact goal.

i have a function

z = 6/5 - (- 5*x^3 + 3*x^2 + (19*x)/4 + 3/4)/(- 10*x^2 + x + 5*y + 1)

now i want to know value of the z(x,y) function where x=1.2 and y=1.2. 

z(1.2 , 1.2) = ?

but the function is symbolic, it's not double. how to solve symbolic function in certain value of x, y.

--------
if the func is double, just write like that.

x=1.2;
y=1.2;
z = 6/5 - (- 5*x^3 + 3*x^2 + (19*x)/4 + 3/4)/(- 10*x^2 + x + 5*y + 1)

ans=1.5435
0
Reply klutch 12/3/2010 4:47:05 PM

"klutch " <klutch52@gmail.com> wrote in message <idb6u9$cej$1@fred.mathworks.com>...
> > Your use of DIFF and your use of the term "initial values" makes me think 
> > you're trying to solve a differential equation (for which DSOLVE would be 
> > the appropriate tool) but your xi doesn't include any derivative terms, so 
> > I'm not _really_ sure what you're trying to do.  Please reply and clarify 
> > your exact goal.
> 
> i have a function
> 
> z = 6/5 - (- 5*x^3 + 3*x^2 + (19*x)/4 + 3/4)/(- 10*x^2 + x + 5*y + 1)
> 
> now i want to know value of the z(x,y) function where x=1.2 and y=1.2. 
> 
> z(1.2 , 1.2) = ?
> 
> but the function is symbolic, it's not double. how to solve symbolic function in certain value of x, y.
> 
> --------
> if the func is double, just write like that.
> 
> x=1.2;
> y=1.2;
> z = 6/5 - (- 5*x^3 + 3*x^2 + (19*x)/4 + 3/4)/(- 10*x^2 + x + 5*y + 1)
> 
> ans=1.5435

%%%%
syms x y

z = 6/5 - (- 5*x^3 + 3*x^2 + (19*x)/4 + 3/4)/(- 10*x^2 + x + 5*y + 1);

subs(z,{x y},{1.2 1.2})
0
Reply Sean 12/3/2010 5:00:22 PM

> subs(z,{x y},{1.2 1.2})

thanks a lot. it works :)
0
Reply klutch 12/3/2010 5:35:05 PM

4 Replies
414 Views

(page loaded in 0.087 seconds)

Similiar Articles:













7/26/2012 5:40:59 AM


Reply: