Post Reply 
[HP PPL] Concatenation inside CAS(..) command does not work
08-05-2024, 05:52 PM
Post: #3
RE: [HP PPL] Concatenation inside CAS(..) command does not work
(08-05-2024 05:55 AM)komame Wrote:  When using a variable in a CAS call on the PPL side, you should indicate that it contains an expression rather than a string.

Use expr like this:
Code:
    expression:="2^3";
    d:=CAS(expr(expression));

However, this still won't work in your case because PPL program cannot return symbolic results (Home doesn't work with symbols).

Programs that operate on symbolic expressions should be written in CAS, not PPL.

I was actually able to work by receiving the symbolic function as a string argument on input, then solving integrals and derivatives using the CAS. prefix:

Code:

  if input(
  {{f, [2]}, {var, [2]}, {lower,[2]}, {upper,[2]}},
        "Prob Ψ",
        {"Ψ=", "var=", "lower=", "upper="}
      )
  then

    f := "(" + f + ")^2";
    e := "∫(" + f + ", " + var + ", " + lower + ", " + upper + ")";
    result:= CAS.expr(e);
    result:= CAS.simplify(result);
    return result;
  end;

That worked best on real calculator.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [HP PPL] Concatenation inside CAS(..) command does not work - Le0ssa - 08-05-2024 05:52 PM



User(s) browsing this thread: 3 Guest(s)