Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14576

Re: NSolve Question

From daniel.lichtblau0@gmail.com
Newsgroups comp.soft-sys.math.mathematica
Subject Re: NSolve Question
Date 2013-05-23 07:16 +0000
Message-ID <knkfo3$hnf$1@smc.vnet.net> (permalink)
References <knerlt$3g$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

NSolve Question "Hagwood, Charles R" <charles.hagwood@nist.gov> - 2013-05-21 04:03 +0000
  Re: NSolve Question daniel.lichtblau0@gmail.com - 2013-05-23 07:16 +0000

csiph-web