Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
how to solve symbolic function with initial values

Subject: how to solve symbolic function with initial values

From: klutch

Date: 3 Dec, 2010 13:45:25

Message: 1 of 5

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.

Subject: how to solve symbolic function with initial values

From: Steven_Lord

Date: 3 Dec, 2010 14:38:01

Message: 2 of 5



"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

Subject: how to solve symbolic function with initial values

From: klutch

Date: 3 Dec, 2010 16:47:05

Message: 3 of 5

> 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

Subject: how to solve symbolic function with initial values

From: Sean de

Date: 3 Dec, 2010 17:00:22

Message: 4 of 5

"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})

Subject: how to solve symbolic function with initial values

From: klutch

Date: 3 Dec, 2010 17:35:05

Message: 5 of 5

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

thanks a lot. it works :)

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us