Carl Love

## 27167 Reputation

11 years, 337 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

## Save taus in loop; print outside...

@pallav Then you need to save the taus while in the loop, and use a statement after the end of the loop to display the values. Like this:

`restart:a := 2; b := .29; d := 1.85;for h from .5 by .1 to 1 do     eq1 := x*(-b*x^2-x+1);     eq2 := y*((a*x*x)/(b*y^2)-d-h*y);     S := solve({eq1, eq2}, {x, y});     SS := solve(subs(S[3], {omega^4+(h*y+x)*omega^2+h^2*x-y}), {omega});     tau[h] := simplify(subs(S[3], subs(SS[3], (b^2*h*y+a*x)/omega)));end do:convert(tau, list)[];`

## Save taus in loop; print outside...

@pallav Then you need to save the taus while in the loop, and use a statement after the end of the loop to display the values. Like this:

`restart:a := 2; b := .29; d := 1.85;for h from .5 by .1 to 1 do     eq1 := x*(-b*x^2-x+1);     eq2 := y*((a*x*x)/(b*y^2)-d-h*y);     S := solve({eq1, eq2}, {x, y});     SS := solve(subs(S[3], {omega^4+(h*y+x)*omega^2+h^2*x-y}), {omega});     tau[h] := simplify(subs(S[3], subs(SS[3], (b^2*h*y+a*x)/omega)));end do:convert(tau, list)[];`

## Example?...

Could you give an example? It is not clear to me why you presented the lists three times.

If they are lists, you should enclose them in []: [a,a,a,b,c]. Otherwise, they are called sequences, which are more difficult to work with than true lists.

Do you want the rules to apply to sublists also? That is, should [b,a,a,a,b,c,e] become [b,b,b,b,c,e,e]?

## That is not returned by solve...

@Markiyan Hirnyk That is not an example, and you know it! I ask for a solution set returned by solve which contains a trivial equation. And that is what the Asker is referring to in his followup to your Answer.

## That is not returned by solve...

@Markiyan Hirnyk That is not an example, and you know it! I ask for a solution set returned by solve which contains a trivial equation. And that is what the Asker is referring to in his followup to your Answer.

## Ungrounded words...

@Markiyan Hirnyk Please kindly show me an example of a solution set returned by solve, or a similar command, which contains a trivial equation and yet represents only a finite number of solutions.

## Ungrounded words...

@Markiyan Hirnyk Please kindly show me an example of a solution set returned by solve, or a similar command, which contains a trivial equation and yet represents only a finite number of solutions.

## How to check for z=z...

Here's how you can quickly check if any solution set (or list) S contains a trivial equation of the form z = z. Do

evalb(`*`(map(lhs-rhs, S)[]) = 0);

The result will be true if and only if S contains a trivial equation.

## How to check for z=z...

Here's how you can quickly check if any solution set (or list) S contains a trivial equation of the form z = z. Do

evalb(`*`(map(lhs-rhs, S)[]) = 0);

The result will be true if and only if S contains a trivial equation.

## But it's the same as what dsolve does...

@fixedeggs But dsolve itself is evaluating the derivatives by using the right sides of dsys8. There is no "built-in interpolant" for this particular step.

But if you really want to do it your way, you just need to add one equation and one initial condition to the system for each derivative that you want to evaluate. For example,

Sys:= {diff(y(t),t) = y(t)}: IC:= {y(0)=1}:
Sys1:= {diff(y(t), t) = w(t)}: IC1:= {w(0)=1}:
Sol:= dsolve(`union`(Sys,Sys1,IC,IC1), {y(t), w(t)}, numeric);
proc(x_rkf45_dae)  ...  end;
Sol(1);
[t = 1., w(t) = 2.7182818283577044,  y(t) = 2.7182818283577044]

## But it's the same as what dsolve does...

@fixedeggs But dsolve itself is evaluating the derivatives by using the right sides of dsys8. There is no "built-in interpolant" for this particular step.

But if you really want to do it your way, you just need to add one equation and one initial condition to the system for each derivative that you want to evaluate. For example,

Sys:= {diff(y(t),t) = y(t)}: IC:= {y(0)=1}:
Sys1:= {diff(y(t), t) = w(t)}: IC1:= {w(0)=1}:
Sol:= dsolve(`union`(Sys,Sys1,IC,IC1), {y(t), w(t)}, numeric);
proc(x_rkf45_dae)  ...  end;
Sol(1);
[t = 1., w(t) = 2.7182818283577044,  y(t) = 2.7182818283577044]

## It's new usage of "so"....

@Preben Alsholm This is a new usage of "so" as an introduction rather than as a continuation, which seems quite prevalent among academics. There is even a weekly radio show Le Show, hosted by Harry Shearer, that has a segment each week (about 2-3 minutes) devoted to playing clips of interviewees introducing their comments with "so". (Recorded episodes available at harryshearer.com/le-show/)

## The original BCs work fine...

The boundary conditions from your original question will work just fine.

S := pdsolve({pde, bc});

## The original BCs work fine...

The boundary conditions from your original question will work just fine.

S := pdsolve({pde, bc});

## You're right...

Sorry, I misunderstood what you meant by "parametrically", but I understand now. My fault: You didn't use the word incorrectly. You're right: The display method will not work to create the parametric plot of one dependent variable versus another.

 First 639 640 641 642 643 644 645 Last Page 641 of 697
﻿