## How to draw a number of circles inscribed in a squ...

Asked by:

I see this question https://mathematica.stackexchange.com/questions/304317/how-to-draw-a-number-of-circles-inscribed-in-a-square-so-that-the-sum-of-the-rad

I have a square with length of side is \$a\$. How to draw a number of circles inscribed in a square so that the sum of the radii of the circle is greatest? In the below picture is twenty circles inscribed in a square. We can consider number of circles are 5, 6, ... We consider number of the circles is fixed.

How can I tell Maple to do that.

## Maple 2024 crash calling solve. Reproducible each ...

Asked by:

I am getting Maple server crash each time running this solve command.

Could others reproduce it? I am using windows 10. Maple 2024.  Why does it happen?

Will report it to Maplesoft in case it is not known. Worksheet below.

 > restart;

 > interface(version);

 > Physics:-Version();

 > sol:=(3^(1/2)*u(x)-1/3*3^(1/2)+(3*u(x)^2-2*u(x)-1)^(1/2))^(1/3*3^(1/2)) = x^(1/3*3^(1/2))*c__1;

 > eval(sol,u(x) = u);

 > timelimit(30,[solve(%,u)]);

Download maple_crash_calling_solve_june_18_2024.mw

This bug seems to have been introduced in Maple 2023 since it crashes there also.

But not in Maple 2022. No crash there. Same PC.

 > restart;
 > interface(version);

 > Physics:-Version();

 > sol:=(3^(1/2)*u(x)-1/3*3^(1/2)+(3*u(x)^2-2*u(x)-1)^(1/2))^(1/3*3^(1/2)) = x^(1/3*3^(1/2))*c__1;

 > eval(sol,u(x) = u);

 > solve(%,u);

Download maple_NO_crash_calling_solve_june_18_maple_2022.mw

## partial dervative of function ?...

Asked by:

using diff command to find  partial dervative of function g give zero in maple...it shouldn't be zero...how to fix itpartial_dervative.mw

 > restart:
 >
 > sigma_t:= map(epsilon-> E_0[90]*epsilon_dot*((epsilon/epsilon_dot)-(sum(p[i], i = 1 .. 3)*(epsilon/epsilon_dot))+(sum(p[i]*tau[i],i=1..3))-(sum(p[i]*tau[i]*exp(-(epsilon/(epsilon_dot*tau[i]))),i=1..3))),true_strain):
 > g:= sum(( sigma[j]-sigma_t[j])^2,j=1..10):
 > diff(g,p[1]);
 (1)

Download partial_dervative.mw

## to simplify or not simplify before calling integra...

Asked by:

Is this a valid behvior by int?

int(A,x,method=_RETURNVERBOSE) hangs.

But  int(simplify(A),x,method=_RETURNVERBOSE) returns in few seconds with "default" result same as int(A,x)

Should this have happen? I try to avoid calling simplify unless neccessary because it can add csgn's and signums and so on to the result.

But the question is: Should one really need to simplify the integrand to get the result in this example? Does this mean one should call simplify on the integrand to avoid the hang that can show up?

This only happens when using method=_RETURNVERBOSE

Just trying to find out if this is normal behavior and can be expected sometimes.

 > interface(version);

 > restart;

 > A:=exp(-1/2*cos(2*x))*exp(-sin(x)^2); int(A,x);

 > int(A,x,method=_RETURNVERBOSE);  #hangs
 > int(simplify(A),x,method=_RETURNVERBOSE)

Download why_int_hang_unless_simplify_june_15_2024.mw

## MapleSim & Modelica_LinearSystems2: Do both work t...

Asked by:

On the corresponding Modelica page I find

Since MapleSim 2024 now has been upgraded to Modelica 4.0 (which I appreciate very much by the way - Thank you), I was wondering if I could give this libraray a try?

I am looking for simple ways to set up digital controllers in the context of developement of code for micro-controllers. From the github page:

Furthermore, in sublibrary Controller about 20 input/output blocks of linear systems are provided that are based on the different representation forms, e.g., PID, StateSpace, Filter blocks. A unique feature of these blocks is that it is very convenient to quickly switch between a continuous and a discrete block representation. Also, templates are provide to quickly built-up standard controller structures.

## Numerical test of the solution of the differential...

Asked by:

hi,

I don't know how to test the answers I got in Mathematica, can you help me?
I can't send the file here, I really need help.

## solve elliptic PDEs...

Asked by:

As Maple is not equipped to handle numerical solutions of elliptic PDEs, can anyone help top solve PDEs by finite differences or any other numerical solver?

pde.mw

## Where is the code that simplifies this ...

Asked by:

Can't figure out what code makes this simplification.
If this simplification works, it will be a part of a larger simplication procedure ( if it not conflicts hopefully)
vereenvouding_hoe_-vraag_MPF.mw

## PDEtools:-Solve vs. solve. RootOf form difference...

Asked by:

I was trying to find out why my solution was not validating for this ode. It turned out because I was using solve instead of PDEtools:-Solve. It took me sometime to find this.

This made huge difference on odetest to verify the solution.

This is very simple ode. We just need to integrate once. But first we have to solve for y'(x).

And here comes the difference. When I used solve to solve for y'(x), odetest did not verify the solution.

When using PDEtools:-Solve, it did.

The difference is how each returned the solution for y'(x). Both have RootOf but written differently and this made the difference.

1) Why solutions are written differently?

2) Is this to be expected? I have thought Solve uses same engine as solve below the cover.

3) is it possible to make solve give the same form as Solve or change to that form?

I am now changing more of my code to use PDEtools:-Solve because of this.

 > interface(version);

 > Physics:-Version();

Using solve

 > restart;

 > ode:=x-ln(diff(y(x),x))-sin(diff(y(x),x))=0; RHS:=solve(ode,diff(y(x),x));

 > mysol:= y(x) = Int(RHS,x)+c__1;

 > odetest(mysol,ode);

using PDEtools:-Solve (now it verifies) with no extra effort

 > restart;

 > ode:=x-ln(diff(y(x),x))-sin(diff(y(x),x))=0; RHS:=PDEtools:-Solve(ode,diff(y(x),x)): RHS:=rhs(%);

 > mysol:= y(x) = Int(RHS,x)+c__1;

 > odetest(mysol,ode);

Download PDEtools_Solve_vs_solve_june_8_2024.mw

Update

Here is a counter example. Where now it is the other way around.

Using solve makes odetest happy, but when using PDEtools:-Solve odetest does not verify the solution.  Same exact ODE.

 > interface(version);

 > Physics:-Version()

Example, using solve works

 > ode:=exp(diff(y(x), x) - y(x)) - diff(y(x), x)^2 + 1 = 0; RHS:=solve(ode,diff(y(x),x)); RHS:=eval(RHS,y(x)=y); mysol:=Intat(eval(1/RHS,y=_a),_a=y(x))=x+c__1; odetest(mysol,ode);

Example, using PDEtools:-Solve fails

 > ode:=exp(diff(y(x), x) - y(x)) - diff(y(x), x)^2 + 1 = 0; RHS:=rhs(PDEtools:-Solve(ode,diff(y(x),x))); RHS:=eval(RHS,y(x)=y); mysol:=Intat(eval(1/RHS,y=_a),_a=y(x))=x+c__1; odetest(mysol,ode);

 >

Download PDEtools_Solve_vs_solve_june_9_2024.mw

So now I have no idea which to use. Sometimes solve works and sometimes Solve works. I  guess I have to now solve the ode both ways each time and see which works.

## My rant of the day...

Asked by:

This is an extremely common situation; either some moderator displaced or deleted the question, or the OP deleted himself (herself).
Whatever the reason, it's always extremely upsetting to be confronted with this situation, which shows how rude, to put it mildly, some people can be.

Initial question (this day, about 2 hours ago)

Comment

## N-Soft set : Membership function, ...

Asked by:

Dear all

I have a data, how can I study this data using N-soft set : Normalized the data, membership function, analyse the risk, ..... compute the risk, interpret the results

Cancer_patient.xlsx

N_soft_set.mw

Thank you for your help

## Visualize a surface : saddle surface...

Asked by:

Maybe someone get the code working ?

```with(plots):
with(VectorCalculus):

# Example 1: Vector Field and Visualization
V := [x, y, z]:
print("Vector Field V:", V):
fieldplot3d([V[1], V[2], V[3]], x = -2..2, y = -2..2, z = -2..2, arrows = slim, title = "Vector Field in 3D"):

# Example 2: Tangent Vector to a Curve
curve := [cos(t), sin(t), t]:
print("Curve:", curve):
tangent := diff(curve, t):
print("Tangent Vector:", tangent):
plot3d([cos(t), sin(t), t], t = 0..2*Pi, labels = [x, y, z], title = "Curve in 3D"):

# Example 3: Curvature of a Surface
u := 'u': v := 'v':
surface := [u, v, u^2 - v^2]:
print("Surface:", surface):

# Compute the first fundamental form
ru := [diff(surface[1], u), diff(surface[2], u), diff(surface[3], u)]:
rv := [diff(surface[1], v), diff(surface[2], v), diff(surface[3], v)]:
E := ru[1]^2 + ru[2]^2 + ru[3]^2:
F := ru[1]*rv[1] + ru[2]*rv[2] + ru[3]*rv[3]:
G := rv[1]^2 + rv[2]^2 + rv[3]^2:
firstFundamentalForm := Matrix([[E, F], [F, G]]):
print("First Fundamental Form:", firstFundamentalForm):

# Compute the second fundamental form
ruu := [diff(surface[1], u, u), diff(surface[2], u, u), diff(surface[3], u, u)]:
ruv := [diff(surface[1], u, v), diff(surface[2], u, v), diff(surface[3], u, v)]:
rvv := [diff(surface[1], v, v), diff(surface[2], v, v), diff(surface[3], v, v)]:
normal := CrossProduct(ru, rv):
normal := eval(normal / sqrt(normal[1]^2 + normal[2]^2 + normal[3]^2)):
L := ruu[1]*normal[1] + ruu[2]*normal[2] + ruu[3]*normal[3]:
M := ruv[1]*normal[1] + ruv[2]*normal[2] + ruv[3]*normal[3]:
N := rvv[1]*normal[1] + rvv[2]*normal[2] + rvv[3]*normal[3]:
secondFundamentalForm := Matrix([[L, M], [M, N]]):
print("Second Fundamental Form:", secondFundamentalForm):

# Compute the Christoffel symbols
# Ensure DifferentialGeometry package is loaded
with(DifferentialGeometry):
DGsetup([u, v], N):
Gamma := Christoffel(firstFundamentalForm):
print("Christoffel Symbols:", Gamma):

# Visualize the surface
plot3d([u, v, u^2 - v^2], u = -2..2, v = -2..2, labels = [u, v, z], title = "Saddle Surface in 3D"):```

## should int() result match exactly what is given as...

Asked by:

Simple question. I hope it has simple answer. I have always thought that what int() returns should match exactly what "default" result shows when using int() with the option _RETURNVERBOSE

I mean exact match. But this below shows that int() result underwent some simplification as it is not the same as default.

```restart;

integrand:=sin(x)/(sin(x) + 1);
maple_result_1 :=int(integrand,x);
maple_result_2 := int(integrand,x,'method'=':-_RETURNVERBOSE')[1]

```

Ofcourse maple_result_2 can be made the same as maple_result_1

```simplify(rhs(maple_result_2)) assuming 0<x and x<Pi;
```

But this is beside the point. Why is "default" is not excatly the same as int() result?  It seems that int() does something more after obtaining the :"default" result as shown.

Should default not match exactly result from int() ?

Maple 2024.

## Numeric Formatting Causes Maple to Hang...

Asked by:

I put together the attached worksheet to help me determine the cheapest way to buy "refreshments" for a party by comparing price and volume of different bottle size options.  The spreadsheet works fine as is.  However, when I right click on the output of line (14) and format pct_difference as percent with 2 decimal places and execute the worksheet, Maple hangs on that line and progresses no further.  This doesn't happen in Maple 2018 but the problem does show up in Maple 2024.  Suggestions please?

cost_comparison_-_liquid_(v01MP).mw

## Section plane solids...

Asked by:

This is still a  starting procedure and let's see what can be added?

 > restart; # Define the procedure to draw a cylinder along the x-axis and a specifically positioned plane CylinderAndPlane := proc(r, h, alpha_deg, beta_deg, P, axis_length)     local alpha, beta, cylinder, plane, pointPlot, display, nx, ny, nz, px, py, pz, annotations, plane_type, titleStr, grafiek;  # Added: titleStr     uses plots, LinearAlgebra;       # Convert angles from degrees to radians     alpha := alpha_deg * Pi / 180;     beta := beta_deg * Pi / 180;     # Determine the normal vector based on angles     nx := cos(alpha) * sin(beta);     ny := sin(alpha) * sin(beta);     nz := cos(beta);     # Point P is directly used as given coordinates     px, py, pz := op(P);     # Cylinder along the x-axis     cylinder := plots:-implicitplot3d(y^2 + z^2 = r^2, x = 0 .. h, y = -r .. r, z = -r .. r, style = surface, color = "LightBlue", transparency = 0.5);     # Determine the type of plane based on angles alpha and beta     if beta_deg = 90 then         plane_type := "yz";         plane := plots:-implicitplot3d(x = px, x = px - 10 .. px + 10, y = -axis_length .. axis_length, z = -axis_length .. axis_length, style = surface, color = "Yellow", transparency = 0.5);     elif alpha_deg = 90 and beta_deg = 0 then         plane_type := "xz";         plane := plots:-implicitplot3d(y = py, x = -axis_length .. axis_length, y = py - 10 .. py + 10, z = -axis_length .. axis_length, style = surface, color = "Green", transparency = 0.5);     elif beta_deg = 0 then         plane_type := "xy";         plane := plots:-implicitplot3d(z = pz, x = -axis_length .. axis_length, y = -axis_length .. axis_length, z = pz - 10 .. pz + 10, style = surface, color = "Blue", transparency = 0.5);     else         plane_type := "arbitrary";         plane := plots:-implicitplot3d(nx * (x - px) + ny * (y - py) + nz * (z - pz) = 0, x = -axis_length .. axis_length, y = -axis_length .. axis_length, z = -axis_length .. axis_length, style = surface, color =            "Red", transparency = 0.7);     end if;     # Mark point P     pointPlot := plots:-pointplot3d([px, py, pz], symbol = solidcircle, symbolsize = 10, color = "Red");     # Create dynamic title - New     titleStr := cat("Plane: ", plane_type, "\nAlpha: ", sprintf("%.2f", alpha_deg), " deg\nBeta: ", sprintf("%.2f", beta_deg), " deg\nPoint: [", sprintf("%.2f", P[1]), ", ", sprintf("%.2f", P[2]), ", ", sprintf("%.2f", P[3]), "]");     # Display everything together - Modified: titleStr added in the display function     grafiek := plots:-display(cylinder, plane, pointPlot, axes = normal, scaling = constrained, labels = ["x", "y", "z"], title = titleStr);     return grafiek; end proc: # Example call to the procedure with coordinates of P and setting the axis length # Alpha and Beta are now angles in degrees, P is a list of coordinates, axis_length is the length of the coordinate axes CylinderAndPlane(15, 50, 0, 90, [15, 5, 5], 30);  # For yz-plane #CylinderAndPlane(5, 15, 90, 0, [5, 5, 5], 10);  # For xz-plane #CylinderAndPlane(5, 15, 0, 0, [5, 5, 5], 10);   # For xy-plane #CylinderAndPlane(5, 55, 45, 45, [5, 5, 5], 10); # For arbitrary plane

Download maple_primes_-doorsnijdingsvlak_solids_procedureDEF.mw

 1 2 3 4 5 6 7 Last Page 3 of 340
﻿