Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Programatically creating delayed

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110258] Re: Programatically creating delayed
  • From: "Stuart Nettleton" <Stuart.Nettleton at uts.edu.au>
  • Date: Thu, 10 Jun 2010 08:10:15 -0400 (EDT)
  • Organization: University of Technology, Sydney
  • References: <201006081106.HAA18787@smc.vnet.net>

Hi Leonid,
I have found a possible solution:

ClearAll[Prev, eqns, a, b];
Prev[vec_] := Flatten[{First[vec], Most[vec]}];
eqns = Hold[
    a == Prev[b],
    b == Table[1, {3}]
    ];
lhs = Map[ToString, Cases[eqns, Equal[m_, n_] -> m]]
Scan[assignElementsFull[#, "element", 3] &, lhs]
eqns2 = Apply[List, Map[ReleaseHold, eqns]]
lhs2 = Cases[eqns2, Equal[m_, n_] -> m]
Solve[eqns2, Flatten[lhs2]]

Stuart

On Thu, 10 Jun 2010 10:28:21 +1000, Stuart Nettleton  
<Stuart.Nettleton at uts.edu.au> wrote:

> Hi Lenoid,
> Your extended function is much appreciated. It will be even more useful  
> now you have generalised it. I have avoided using Hold until now because  
> it seemed to be quite an advanced topic. As you will see from my next  
> question, I am still a bit vague when it comes to this function.
> My intended use for your assignElementsFull function is in a modelling  
> application that I simplify to the following for illustration:
> Clear[Prev, eqns, a, b];
> Prev[vec_] := Flatten[{First[vec], Most[vec]}];
> eqns = {a == Prev[b], b == Table[1, {3}]};
> lhs = Map[ToString[#] &, Cases[eqns, Equal[m_, n_] -> m]]
> Scan[assignElementsFull[#, "element", 3] &, lhs]
> eqns2 = Flatten[Map[Thread[#] &, eqns]]
> Solve[eqns2, Flatten[lhs]]
>
> I would like to isolate the left hand side of the equations without  
> evaluation, and then use these variables to create element vectors. Then  
> I would like to use the variables in the vector form. My experiments  
> using Hold to eliminate the errors have not yet been satisfactory.  
> Please excuse my laborious syntax!
> Would you be able to suggest a way forward?
> Many thanks,
> Stuart


-- 
Dr Stuart Nettleton
PhD, FCPA, MBA, MEngSci, BEng(Hons), GradDipAICD
Senior Lecturer
School of Management & Systems
Faculty of Engineering & IT
Energy Policy Research Centre

This e-mail may be confidential and /or legally privileged.  It is  
intended solely for the addressee.  Access to this e-mail by anyone else  
is unauthorised. If you are not the intended recipient, any disclosure,  
copying, distribution or any action taken or omitted to be taken in  
reliance on it, is prohibited and may be unlawful.

Virus Information: It is the recipient/client's duty to virus scan and
otherwise test the information provided before loading onto any computer  
system. No warranty is made that this material is free from computer virus  
or any other defect or error. Any loss/damage incurred by using this  
material is not the sender's responsibility.

--
UTS CRICOS Provider Code:  00099F
DISCLAIMER: This email message and any accompanying attachments may contain
confidential information.  If you are not the intended recipient, do not
read, use, disseminate, distribute or copy this message or attachments.  If
you have received this message in error, please notify the sender
immediately and delete this message. Any views expressed in this message
are those of the individual sender, except where the sender expressly, and
with authority, states them to be the views the University of Technology,
Sydney. Before opening any attachments, please check them for viruses and
defects.


  • Prev by Date: Re: General question regarding solving equations
  • Next by Date: Re: PDE, laplace, exact, should be simple...
  • Previous by thread: Re: Programatically creating delayed
  • Next by thread: Re: Programatically creating delayed assignment