## Solution types in custom components: Is that still...

In a video (watch from 7 min onwards) I have seen the definition of solution types in custom components. Is this possible in newer versions of MapleSim using the custom component app? If yes, how?

## How do I plot data with dates (YYYY-MM-DD format)....

The Dates are not ordered in a timeseries. The Dates are random variables coming from a dataFrame

## How can I write a formula for odd numbers?...

How can I write a formula for odd numbers?
Such that :
Show each odd number from the sum of two numbers: even + odd, except for one

## The strange behavior of IsSubgraphIsomorphic requ...

The IsSubgraphIsomorphic command accepts either two undirected graphs or two directed graphs as input.  It returns true if G1 is isomorphic to some subgraph of G2. The GraphTheory [IsSubgraphIsomorphic] command was introduced in Maple 2021.

If a graph T is isomorphic to some subgraph T' of  a graph GIsSubgraphIsomorphic(T,G)  will  return true. But there is no option to return T'. That makes it hard to check manually.

I've seen  IsSubgraphIsomorphic behaving strangely lately. I want to check whether K8-P6 contains K7-K3 as its subgraph.

T:=DeleteEdge(CompleteGraph(7),{{1,2},{2,3},{3,1}},inplace= false):
G:=DeleteEdge(CompleteGraph(8),{{1,2},{2,3},{3,4},{4,5},{5,6}},inplace= false):
IsSubgraphIsomorphic(T,G)

true

I think theoretically, the result of IsSubgraphIsomorphic is not correct. I also tested it from Mathematica, and it worked as I expected.

h = EdgeDelete[ CompleteGraph[7], {1 <-> 2, 2 <-> 3, 3 <-> 1}];
g = EdgeDelete[ CompleteGraph[8], {1 <-> 2, 2 <-> 3, 3 <-> 4, 4 <-> 5, 5 <-> 6}];
IsomorphicSubgraphQ[h, g]

False

I wonder what went wrong.

PS: Subgraph isomorphism is a question I've asked before, and we can refer to the following links and code. https://www.mapleprimes.com/questions/226937-How-To--Test--A--Graph--Whether-Contains

with(GraphTheory):
with(combinat):
T:=DeleteEdge(CompleteGraph(7),{{1,2},{2,3},{3,1}},inplace= false):
G:=DeleteEdge(CompleteGraph(8),{{1,2},{2,3},{3,4},{4,5},{5,6}},inplace=false):
nE,nV := NumberOfEdges(T), NumberOfVertices(T):
# Produce all subgraphs of G which have the same number of edges and vertices as the "test" sub-graph T
U:=choose(Edges(G),nE): nops(%):
U1:=select(t -> (nops(`union`(t[]))=nV), U): nops(%):
gL:= Graph~(U1): nops(%):
ans:= [ seq
( `if`
( IsIsomorphic( T, gL[j] ),
j,
NULL
),
j=1..numelems(gL)
)
]:
if   numelems(ans)>0
then HighlightSubgraph( G, gL[ans[1]], edgestylesheet=[thickness=4, color="Red"]);
DrawGraph(G, style=spring);
fi;

These codes are due to tomleslie  and  vv. According to above codes, it seems that there is something wrong with IsSubgraphIsomorphic too.

## formatting the output generated by writeto(filenam...

I capture the output of dsolve after setting infolevel to some file so I can later read that output and put it in my own document (Latex).

Currently what I do is set infolevel, then use writeto(file_name) to send all the output that would normally go to standard output to the text file, then later do readline to read it back for further processing.

The problem is that Maple does not put the output in the file the same way as it appears on the screen when using worksheet.

For example, all newlines are lost. So everything comes out in one line in the file_name .  I am not sure why that is.

Is there an option or trick to make the output not lose the newlines? It also seems to format things differently in the file. An example will make this clear

When running this code

restart;
currentdir("... set the directory to where you want to save the file to ..");

infolevel[:-dsolve]:=5;
writeto("output_of_dsolve.txt");  #send all output to file
sol:=dsolve(diff(y(x),x)=sin(x),y(x));
close("output_of_dsolve.txt"):
writeto(terminal); #to send output back to terminal

When I open the file output_of_dsolve.txt this is what shows

`Methods for first order ODEs:``--- Trying classification methods ---``trying a quadrature``<- quadrature successful`     solAssignyApplyFunction(x)equalsuminus0cosApplyFunction(x) + _C1, [

Typesetting:-mprintslash([sol := y(x) = -cos(x) + _C1],

[y(x) = -cos(x) + _C1])]

But in the worksheet, when I run the same code without writeto("output_of_dsolve.txt");  so output goes to terminal as normal, here it is how it looks like

Is there a way to keep the newlines? And why there is some extra stuff in the file that do not show on the screen? Should one change the Settings for Display before doing the above? Currently the default I have is typesetting level is "Extended". Do not know if this affects it or not.

Is the above method the only way to capture the output of dsolve from infolevel to a text file? It looks like Maple uses `` in the file in place where there should be a newline (CR) inserted.

Update

I did this experiment but there is still some strange formatting coming out in the file. Here is an example

restart;

currentdir(".....");

:-infolevel[:-dsolve]:=5;
writeto("output_of_dsolve.txt");
sol:=dsolve(diff(y(x),x)=sin(x),y(x));
close("output_of_dsolve.txt"):
writeto(terminal);

And now the text file has this

`Methods for first order ODEs:``--- Trying classification methods ---``trying a quadrature``<- quadrature successful`Typesetting:-mprintslash([(sol := y(x) = -cos(x)+_C1)],[y(x) = -cos(x)+_C1])

What is Typesetting:-mprintslash at the end of the line above? it is duplicate.

And how to get rid of it? Is there another settings to set other than interface(typesetting=standard): and interface(prettyprint=0): ?

## How do I only plot certain points from a list?...

I have a set of points. I only want to plot ones with x and y less that 5 units from [0,0]. I can do it with for do loop. Can't get it to work with seq. Ideally I don't want to create another list.

 (1)

## How do I deal with infinite solutions in Multivari...

The Multivariate Calculus lagrange multipliers function acts weird if I try  to compute something with infinite Extrema like sin(x)+sin(y) with the constraint being a straight line like 1-x-y=0
The output is something like
[1 + arctan((cos(1) - 1)/sin(1)) - Pi*_Z7, -arctan((cos(1) - 1)/sin(1)) + Pi*_Z7]

and trying to output a plot fails outright.

My questions are:

1) What exactly is this z7 in the output?

2) is there a way to get Lagrange multipliers to output concrete values for some of the infinite points, like for example, all points with -2<x<2?

3) If 2) is not possible, how could I calculate the points manually?

## how to Rearrange an Equation to a transfer functio...

I tried to simplify this equation:

where Ts,Cf,Rf,Lg & L are Variables to equivelent equation in the form of:

(.....)Z3+(....)Z2+(.....)Z+(.........)      /   (.....)Z3+(....)Z2+(.....)Z+(.........)

## Simplify formula...

Hello, everyone. I encountered one question on simplification.

I don't know how to plug the conditions

x1^2+y1^2=r^2, x2^2+y2^2=r^2,x3^2+y3^2=r^2,x4^2+y4^2=r^2

and further simplify the formula

4*x1*x2^2*x3 - 4*x1*x2*x3*x4 + 4*x1*x3*y2^2 - 4*x1*x3*y2*y4 - 4*x2^2*x3^2 - 4*x2^2*y2^2 + 4*x2^2*y2*y4 + 4*x2*x3^2*x4 + 4*x2*x4*y2^2 - 4*x2*x4*y2*y4 - 4*x3^2*y2^2 + 4*x3^2*y2*y4 - 4*y2^4 + 8*y2^3*y4 - 4*y2^2*y4^2.

Thank you very much!

## use of a python open source package...

I would like to use a python open source package available on internet via pip install in maple on my maple code

Package name mathchem

Link of the package mathchem · PyPI

## How to recover the name of a variable?...

When using the Statistics package to declare a variable, let's say A,  as random, this variable is associated (assigned?) to a variable of name _R or _Rn with n a non-negative integer.
Subsequently, each expression you construct that contains the name A is displayed in a form where A has been replaced by its "alias" name _Rn.
Here is an example

restart:
with(Statistics):
A := RandomVariable(Uniform(0, 1)):
B := RandomVariable(Uniform(0, 2)):
C := RandomVariable(Uniform(1, 2)):
F :=  (A+2*B)/C
_R + 2 _R0
-----------
_R1

Is it possible,  to display F under its original form?
Is it possible to recover that _R is in fact A, that _R0 is in fact B and so on?

## Multiple plots using seq command...

y := x+k;
plot([seq(y, k = 1 .. 4)]);

Can we plot for decimal values of k, i.e., for k=1.1, 1.2, 1.3? How can we give scale for k?

## How to solve this equation by using HPM technique...

 >
 >
 > #c2
 >
 >

#boundary condition

f=-1, f^'=0, g=0, a=1, b=1   at  η=-1

f=1, f^'=0, g=0, a=0, b=0   at  η=-1

 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 >
 >
 >
 >
 (4)
 >
 >
 (5)
 >
 (6)
 >
 (7)
 >
 (8)
 >
 (9)
 >
 >
 (10)
 >

## What recursion?...

I  had to deal with a long number x =  521...773 that i wanted to break up into 3 digit segments. I converted x to a string and got y="521...773". Then I used String Tools to LengthSplit y and got a sequence z="521", ..."773". So far so good. Next I tried to extract the 3 digit segments and tried
convert(z[1],integer) but that led to

Error, (in anonymous procedure called from depends) too many levels of recursion

Very mysterious. The command convert("521",name)  gave me the symbol 521, not the number.
I eventually stumbled across parse("521") and that gave me what I wanted,namely the integer 521. I looked at the Help page for parse but decided I did not want to delve into that bit of arcane knowledge.

I also tried several times to write little procedures to strip off the double quotes but was unsuccessful.