MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: NSolve Question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg130864] Re: NSolve Question
  • From: daniel.lichtblau0 at gmail.com
  • Date: Wed, 22 May 2013 02:18:30 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <knerlt$3g$1@smc.vnet.net>

On Monday, May 20, 2013 11:03:09 PM UTC-5, Hagwood, Charles R wrote:
> I have a known function f[x,y] and I want to solve the differential
>
>  equation (1)  for v[t], using NSolve
>
>  partial [f(v[t],v'[t])/partial x +(d/dt)[partial f(v[t],v'[t])/partial y=0                (1)
> 
>  where  v'[t] = derivative of v[t] with respect to t.
>
>  I  did a test to set up (1).  I let
>
>  f[x_,y_]:=x^2+y^3
>
>  v[t]:=Sin[t]
>
>  g1[x_,y_]:=partial f(x,y)/partial x
>
>  g2[x_,y_]:=partial f(x,y)/partial y
>
>  g3[t_]:=g1[v[t],v'[t]]+D[g2[v[t],v'[t]],t]
> 
>  and asked Mathematica to evaluate
>
>  g3[t]
>
>  but,  Mathematica gives an error. Thanks for the help
> 
>  Charles

Hard to know exactly what you did because there is some traditional form, I guess, in what you show. My guess is the issue is in the definition of v[t_], wherein the pattern underbar was omitted. That would mess up the definition in a way that would make g3[t] give a bad result.

Here is code that seems to work.

f[x_,y_] := x^2+y^3
v[t_] := Sin[t]
g1[x_,y_] := D[f[x,y],x]
g2[x_,y_] := D[f[x,y],y]
g3[t_] := g1[v[t],v'[t]]+D[g2[v[t],v'[t]],t]

Then g3[t] gives

Out[18]= 2 Sin[t] - 6 Cos[t] Sin[t]

Daniel Lichtblau
Wolfram Research




  • Prev by Date: Average the same elements of the list
  • Next by Date: Re: Work on Basic Mathematica Stephen!
  • Previous by thread: NSolve Question
  • Next by thread: setting highlight color and font size